forked from shaba/openuds
45 lines
982 B
Bash
Executable File
45 lines
982 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
. /usr/share/debconf/confmodule
|
|
db_version 2.0
|
|
|
|
# This conf script is capable of backing up
|
|
db_capb backup
|
|
|
|
if [ -f /etc/udsactor/udsactor.cfg ] && [ "$1" != "reconfigure" ]; then
|
|
echo "/etc/udsactor/udsactor.cfg already exists, leaving untouched."
|
|
exit 0
|
|
fi
|
|
|
|
STATE=1
|
|
while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
|
|
case "$STATE" in
|
|
1)
|
|
db_input high udsactor/host || true
|
|
;;
|
|
2)
|
|
db_input high udsactor/secure || true
|
|
;;
|
|
3)
|
|
db_input high udsactor/masterKey || true
|
|
;;
|
|
esac
|
|
|
|
if db_go; then
|
|
STATE=$(($STATE + 1))
|
|
else
|
|
STATE=$(($STATE - 1))
|
|
fi
|
|
|
|
done
|
|
|
|
# If "cancelled", exit
|
|
if [ "$STATE" = 0 ]; then
|
|
exit 0
|
|
fi
|
|
|
|
# If using reconfigure, and already exists an configuration file, move it to a backup
|
|
if [ -f /etc/udsactor/udsactor.cfg ] && [ "$1" = "reconfigure" ]; then
|
|
echo "/etc/udsactor.cfg backup to /etc/udsactor.cfg.back"
|
|
mv /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.back
|
|
fi |