From 583b80edabd301fd7e10c22b29375c2d37a5f050 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Thu, 23 Oct 2025 00:58:41 -0600 Subject: [PATCH] 1761202721 --- nuke_me_NOW.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/nuke_me_NOW.sh b/nuke_me_NOW.sh index aae8627..ec25a9d 100644 --- a/nuke_me_NOW.sh +++ b/nuke_me_NOW.sh @@ -1,6 +1,6 @@ #!/bin/bash # todo: find them and parse them -set -e +# set -e debug=1 # 1 to enable any other to disable if [[ $debug == 1 ]]; then @@ -13,11 +13,13 @@ fi lsblk --list | awk '{printf "%s%s\n", "/dev/",$1}' | tail -n +2 | \ while read device; do - echo $device - if [[ $(cryptsetup isLuks $device) == 0 ]]; then - # nuke the luks headers - nice -20 cryptsetup erase -q $device 1>>$output_log 2>>$error_log || cryptsetup erase -q --disable-lock $device 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 + if [ -f $device ]; then + isLuks=$(cryptsetup isLuks $device) 2>>$error_log 1>>$output_log + if [[ $(cryptsetup isLuks $device) == 0 ]]; then + # nuke the luks headers + nice -20 cryptsetup erase -q $device 1>>$output_log 2>>$error_log || cryptsetup erase -q --disable-lock $device 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 done \ No newline at end of file