zoneminder/distros/debian8/zoneminder.config

65 lines
1.7 KiB
Plaintext
Raw Normal View History

2014-12-01 00:55:26 +08:00
#!/bin/sh
# This file is the debconf config script used to configure ZoneMinder
# This script asks questions and retains the answers for the postinst script
set -e
# Source the debconf module
. /usr/share/debconf/confmodule
# Set our version (maybe used to compare versions in the futur)
dbc_first_version="1.28.0-0.3"
# Source the db-config-common module to manage the database
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
# Currently we only support mysql
dbc_dbtypes="mysql"
dbc_authmethod_user="password"
. /usr/share/dbconfig-common/dpkg/config
#DEBHELPER#
dbc_go zoneminder $@
fi
# Use upgrade mode if the package is already configured
if [ -z "$old_version" ]; then
db_input high zoneminder/debconf_upgrade || true
fi
# Ask the user if debconf shall be used to configure the package
db_input high zoneminder/debconf_install || true
db_go || true
db_get zoneminder/debconf_install
# Exit if the user don't want to use debconf
if [ "$RET" = false ]; then
DEBCONF_SKIPPED=true
exit 0
fi
# Ask the user for the administrator login and password
db_input high zoneminder/admin_login || true
db_input high zoneminder/admin_password || true
db_go || true
# Don't overwrite configuration if the package is already configured
if [ -z "$old_version" ]; then
# Get the administrator login and set a default value if empty
db_get zoneminder/admin_login
ADMIN_LOGIN=${RET:-admin}
# Get the admimistrator password and set a default value if empty
db_get zoneminder/admin_password
ADMIN_PASSWORD=${RET:-admin}
# Get the list of webservers to configure
db_input high zoneminder/webserver || true
db_go || true
db_get zoneminder/webserver
WEBSERVERS="$RET"
fi
exit 0