#!/bin/bash ### Inserisci qui la partizione crypt da usare CRYPT=/dev/hda8 ### Inserisci qui la partizione LOOP da usare LOOP=/dev/loop5 #### Selezionare la cartella dove montare la partizione criptata DEST=/crypt ### Seleziona un algoritmo di compressione ### decommentando quello preferito #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.... " /sbin/losetup -e $ALG $LOOP $CRYPT /bin/mount -t ext2 $LOOP $DEST /bin/chmod 1777 $DEST echo "done." ;; stop) echo -n "Umounting encrypted User space..." /bin/umount $DEST /sbin/losetup -d $LOOP /bin/sync echo "done." ;; status) /bin/mount | /bin/grep loop ;; restart) $0 stop $0 start ;; *) echo "Usage: $0{start|stop|restart|status}" exit 1 ;; esac