#!/bin/bash CRYPT=/dev/hda2 NAME=crypt-dati0 DEST=/mnt/dati #ALG=twofish #ALG=sha256 #ALG=serpent #ALG=des #ALG=cast5 #ALG=sha512 #ALG=sha1 #ALG=cast6 #ALG=blowfish ALG=aes case "$1" in start) echo -n "Initializing encrypted User space... " /usr/bin/cryptsetup remove $NAME > /dev/null 2>&1 /usr/bin/cryptsetup create $NAME $CRYPT /bin/mount $DEST > /dev/null 2>&1 /bin/chown -R bunker.users $DEST /bin/chmod -R go-rwx $DEST #echo "Done!" ;; stop) echo -n "Umounting encrypted User space... " /bin/umount $DEST > /dev/null 2>&1 /usr/bin/cryptsetup remove $NAME echo "Done!" ;; status) /bin/mount | /bin/grep $NAME ;; restart) $0 stop $0 start ;; *) echo "Usage: $0{start|stop|restart|status}" exit 1 ;; esac