Add wipe option for luks
This commit is contained in:
parent
ee8598d00d
commit
fefa10d12e
1 changed files with 16 additions and 4 deletions
20
archfi
20
archfi
|
@ -551,12 +551,24 @@ formatdevice(){
|
||||||
echo ""
|
echo ""
|
||||||
echo "$txtopenluksdevice"
|
echo "$txtopenluksdevice"
|
||||||
cryptsetup luksOpen $2 $1
|
cryptsetup luksOpen $2 $1
|
||||||
if (whiptail --backtitle "$apptitle" --title "luks" --yesno "Wipe device (recommended) ?" 0 0) then
|
options=()
|
||||||
|
options+=("normal" "")
|
||||||
|
options+=("fast" "")
|
||||||
|
sel=$(whiptail --backtitle "$apptitle" --title "Wipe device" --menu "Wipe device (recommended) ?" --no-button="Ignore" 0 0 0 \
|
||||||
|
"${options[@]}" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
clear
|
clear
|
||||||
dd if=/dev/zero of=/dev/mapper/$1 2>&1 | whiptail --backtitle "$apptitle" --title "luks" --gauge "Please wait..." 0 0 0
|
case $sel in
|
||||||
#echo "if=/dev/zero of=/dev/mapper/$1"
|
normal) dd if=/dev/zero of=/dev/mapper/$1 & PID=$! &>/dev/null;;
|
||||||
#dd if=/dev/zero of=/dev/mapper/$1
|
fast) dd if=/dev/zero of=/dev/mapper/$1 bs=30M & PID=$! &>/dev/null;;
|
||||||
|
esac
|
||||||
|
sleep 1
|
||||||
|
while kill -USR1 $PID &>/dev/null
|
||||||
|
do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
echo ""
|
||||||
pressanykey
|
pressanykey
|
||||||
formatdevice $1 /dev/mapper/$1 noluks
|
formatdevice $1 /dev/mapper/$1 noluks
|
||||||
if [ "$1" = "root" ]; then
|
if [ "$1" = "root" ]; then
|
||||||
|
|
Loading…
Reference in a new issue