2005-11-30 03:39:17 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2005-12-13 02:27:33 +00:00
|
|
|
# read the default setting file, if it exists
|
|
|
|
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox
|
|
|
|
|
|
|
|
# set CONF_FILE to default value, if not configured in /etc/default/cryptobox
|
|
|
|
CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
|
|
|
|
|
|
|
|
# parse config file
|
|
|
|
if [ -e "$CONF_FILE" ]
|
|
|
|
then . "$CONF_FILE"
|
|
|
|
# create mount and config directories with appropriate permissions
|
2005-12-13 20:39:14 +00:00
|
|
|
[ ! -e "$MNT_PARENT" ] && mkdir -p "$MNT_PARENT"
|
2005-12-13 02:27:33 +00:00
|
|
|
[ ! -e "$CONFIG_DIR" ] && mkdir -p "$CONFIG_DIR" && \
|
|
|
|
chown "$WEB_USER" "$CONFIG_DIR" && chmod 700 "$CONFIG_DIR"
|
|
|
|
[ ! -e "$LOG_FILE" ] && touch "$LOG_FILE" && chown "$WEB_USER" "$LOG_FILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2005-11-30 03:39:17 +00:00
|
|
|
# add the cryptobox startup script to /etc/rc?.d
|
2005-12-01 18:22:05 +00:00
|
|
|
update-rc.d cryptobox defaults 98
|
2005-11-30 03:39:17 +00:00
|
|
|
|
2005-12-01 19:20:36 +00:00
|
|
|
invoke-rc.d cryptobox restart
|
|
|
|
|
2005-12-12 22:32:22 +00:00
|
|
|
if grep -q "cryptobox package.*HEADER" /etc/sudoers
|
|
|
|
then true
|
|
|
|
else echo "Adding a new (disabled) entry to /etc/sudoers"
|
|
|
|
cat >>/etc/sudoers <<-EOF
|
|
|
|
######### Automatically inserted by cryptobox package - do not remove - HEADER ######
|
|
|
|
# read /usr/share/doc/cryptobox/SECURITY carefully before enabling the following line
|
|
|
|
#www-data ALL=NOPASSWD:/usr/lib/cryptobox/cbox-root-actions.sh
|
|
|
|
######### Automatically inserted by cryptobox package - do not remove - FOOTER ######
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
2005-12-01 19:20:36 +00:00
|
|
|
true
|