1761202721
This commit is contained in:
+9
-7
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# todo: find them and parse them
|
# todo: find them and parse them
|
||||||
set -e
|
# set -e
|
||||||
debug=1 # 1 to enable any other to disable
|
debug=1 # 1 to enable any other to disable
|
||||||
|
|
||||||
if [[ $debug == 1 ]]; then
|
if [[ $debug == 1 ]]; then
|
||||||
@@ -13,11 +13,13 @@ fi
|
|||||||
|
|
||||||
lsblk --list | awk '{printf "%s%s\n", "/dev/",$1}' | tail -n +2 | \
|
lsblk --list | awk '{printf "%s%s\n", "/dev/",$1}' | tail -n +2 | \
|
||||||
while read device; do
|
while read device; do
|
||||||
echo $device
|
if [ -f $device ]; then
|
||||||
if [[ $(cryptsetup isLuks $device) == 0 ]]; then
|
isLuks=$(cryptsetup isLuks $device) 2>>$error_log 1>>$output_log
|
||||||
# nuke the luks headers
|
if [[ $(cryptsetup isLuks $device) == 0 ]]; then
|
||||||
nice -20 cryptsetup erase -q $device 1>>$output_log 2>>$error_log || cryptsetup erase -q --disable-lock $device 1>>$output_log 2>>$error_log
|
# nuke the luks headers
|
||||||
# immediate halt power
|
nice -20 cryptsetup erase -q $device 1>>$output_log 2>>$error_log || cryptsetup erase -q --disable-lock $device 1>>$output_log 2>>$error_log
|
||||||
nice -20 poweroff -ff 1>>$output_log 2>>$error_log || shutdown -P now 1>>$output_log 2>>$error_log
|
# immediate halt power
|
||||||
|
nice -20 poweroff -ff 1>>$output_log 2>>$error_log || shutdown -P now 1>>$output_log 2>>$error_log
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
Reference in New Issue
Block a user