From 28cc0be47fb0206b076a6c83d9a79c6a0fcf705e Mon Sep 17 00:00:00 2001 From: age Date: Fri, 21 Oct 2005 15:59:56 +0000 Subject: [PATCH] added box-purge functionnality --- cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh index 4fbc2be..ef3a6e9 100755 --- a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh +++ b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh @@ -315,6 +315,7 @@ function box_purge() local device=$(find_harddisk) log_msg "Purging $device ..." dd if=/dev/zero of=$device bs=1M count=1 + log_msg " " } @@ -440,9 +441,6 @@ case "$ACTION" in else echo -n "'$0' box-init-bg" | at now fi ;; - box-purge ) - box_purge - ;; is_crypto_mounted ) is_crypto_mounted ;; @@ -478,6 +476,13 @@ case "$ACTION" in diskinfo ) $SFDISK -L -q -l `find_harddisk` ;; + box-purge ) + log_msg "Cleaning the CryptoBox ..." + $0 crypto-down + $0 config-down + box_purge + $0 diskinfo + ;; poweroff ) is_crypto_mounted && umount_crypto log_msg "Turning off the CryptoBox ..." @@ -488,15 +493,6 @@ case "$ACTION" in log_msg "Rebooting the CryptoBox ..." echo "reboot" | at now ;; - clean ) - # only for development - log_msg "Cleaning the CryptoBox ..." - device=$(find_harddisk) - $0 crypto-down - $0 config-down - # TODO: test this! - echo -e ";\n;\n;\n;\n" | $SFDISK "$device" - ;; * ) echo "Syntax: `basename $0` ACTION [PARAMS]" echo " config-up - scan for configuration partition and mount it" @@ -520,8 +516,8 @@ case "$ACTION" in echo " set_config NAME VALUE - change a configuration setting" echo " get_config NAME - retrieve a configuration setting" echo " diskinfo - show the partition table of the harddisk" + echo " box-purge - destroy partitiontable of the harddisk (delete everything)" echo " poweroff - shutdown the cryptobox" - echo " clean - remove all partitions [only for development]" echo " reboot - reboot the cryptobox" echo ;;