summaryrefslogtreecommitdiff
path: root/veracrypt/debian/veracrypt.init
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-01-30 15:40:06 -0500
committerB Stack <bgstack15@gmail.com>2019-01-30 15:40:06 -0500
commite9120a776ff758709db504702eb3a44940bdd26e (patch)
tree7eaa53b9b4c888038696252b49d535f1e1deec6b /veracrypt/debian/veracrypt.init
parentadd palemoon dpkg for devuan (diff)
downloadstackrpms-e9120a776ff758709db504702eb3a44940bdd26e.tar.gz
stackrpms-e9120a776ff758709db504702eb3a44940bdd26e.tar.bz2
stackrpms-e9120a776ff758709db504702eb3a44940bdd26e.zip
add veracrypt dpkg first draft
Diffstat (limited to 'veracrypt/debian/veracrypt.init')
-rw-r--r--veracrypt/debian/veracrypt.init56
1 files changed, 56 insertions, 0 deletions
diff --git a/veracrypt/debian/veracrypt.init b/veracrypt/debian/veracrypt.init
new file mode 100644
index 0000000..398838a
--- /dev/null
+++ b/veracrypt/debian/veracrypt.init
@@ -0,0 +1,56 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: veracrypt
+# Required-Start:
+# Required-Stop: $remote_fs
+# Should-Start:
+# Should-Stop:
+# Default-Start:
+# Default-Stop: 0 1 6
+# Short-Description: Remove remaining VeraCrypt device mappings.
+# Description: This init script will dismount mounted VeraCrypt partitions before shutdown.
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+VERACRYPT_SHUTDOWN_UNMOUNT="yes"
+
+. /lib/lsb/init-functions
+
+[ -x /usr/bin/veracrypt ] || exit 0
+
+if [ -r /etc/default/veracrypt ]; then
+ . /etc/default/veracrypt
+fi
+
+case "${VERACRYPT_SHUTDOWN_UNMOUNT}" in
+[Nn]*)
+ exit 0
+ ;;
+esac
+
+do_stop()
+{
+ log_action_begin_msg "Removing VeraCrypt device mappings"
+ veracrypt -d
+ log_action_end_msg $?
+}
+
+case "$1" in
+ start)
+ # No-op
+ ;;
+ status)
+ veracrypt --list
+ ;;
+ restart|reload|force-reload)
+ # No-op
+ ;;
+ stop)
+ do_stop
+ ;;
+ *)
+ echo "Usage: $0 stop|status" >&2
+ exit 3
+ ;;
+esac
+
bgstack15