2005-11-30 04:39:17 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-11-22 16:21:21 +01:00
|
|
|
LOG_FILE=/var/log/cryptobox.log
|
|
|
|
WEBLOG_FILE=/var/log/cryptoboxwebserver.log
|
|
|
|
PID_DIR=/var/run/cryptobox
|
|
|
|
SUPER_FILE=/etc/super.tab
|
|
|
|
|
|
|
|
remove_super_lines()
|
|
|
|
{
|
|
|
|
## do nothing, if there is no CryptoBox line
|
|
|
|
grep -q "CRYPTOBOX_MARKER" "$SUPER_FILE" || return 0
|
|
|
|
sed -i /CRYPTOBOX_MARKER/d "$SUPER_FILE"
|
|
|
|
sed -i /CryptoBoxRootActions/d "$SUPER_FILE"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
remove_log_files()
|
|
|
|
{
|
|
|
|
test -e "$LOG_FILE" && rm "$LOG_FILE"
|
|
|
|
test -e "$LOG_FILE" && rm "$WEBLOG_FILE"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
remove_pid_dir()
|
|
|
|
{
|
|
|
|
test -e "$PID_DIR" && rm -r "$PID_DIR"
|
|
|
|
}
|
|
|
|
|
|
|
|
################## main ###################
|
|
|
|
|
2006-05-30 11:08:35 +02:00
|
|
|
if test "$1" = "purge" && getent passwd cryptobox 2>/dev/null >/dev/null \
|
2006-11-10 10:05:14 +01:00
|
|
|
&& test "$(cd ~cryptobox;pwd)" = /var/cache/cryptobox
|
2006-05-15 11:41:00 +02:00
|
|
|
then echo "Removing user 'cryptobox' ..."
|
|
|
|
userdel -r cryptobox
|
2006-11-22 16:21:21 +01:00
|
|
|
remove_log_files
|
|
|
|
remove_pid_dir
|
2006-05-15 11:41:00 +02:00
|
|
|
fi
|
2005-12-12 23:32:22 +01:00
|
|
|
|
2006-11-22 16:21:21 +01:00
|
|
|
## always remove the lines from the 'super' configuration file
|
|
|
|
remove_super_lines
|
|
|
|
|
2006-05-30 21:00:34 +02:00
|
|
|
#DEBHELPER#
|
2006-05-30 11:08:35 +02:00
|
|
|
|
2005-12-01 19:22:05 +01:00
|
|
|
# return without error
|
|
|
|
true
|