diff options
Diffstat (limited to 'debian/truecrypt.init')
-rwxr-xr-x | debian/truecrypt.init | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/truecrypt.init b/debian/truecrypt.init new file mode 100755 index 0000000..b0deb74 --- /dev/null +++ b/debian/truecrypt.init @@ -0,0 +1,54 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: truecrypt +# Required-Start: +# Required-Stop: $remote_fs +# Should-Start: +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Remove remaining TrueCrypt device mappings. +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +TRUECRYPT_SHUTDOWN_UNMOUNT="yes" + +. /lib/lsb/init-functions + +[ -x /usr/bin/truecrypt ] || exit 0 + +if [ -r /etc/default/truecrypt ]; then + . /etc/default/truecrypt +fi + +case "${TRUECRYPT_SHUTDOWN_UNMOUNT}" in +[Nn]*) + exit 0 + ;; +esac + +do_stop() +{ + log_action_begin_msg "Removing TrueCrypt device mappings" + truecrypt -d + log_action_end_msg $? +} + +case "$1" in + start) + # No-op + ;; + restart|reload|force-reload) + # No-op + ;; + stop) + do_stop + ;; + *) + echo "Usage: $0 stop" >&2 + exit 3 + ;; +esac + +exit 0 |