Scripts: Add erase-disk.sh
This commit is contained in:
parent
7e8a59ae9c
commit
332473358f
|
@ -24,6 +24,7 @@ sleep 0.4
|
|||
echo "Making scripts executable..."
|
||||
|
||||
chmod +x scripts/.local/bin/clear-clipboard.sh
|
||||
chmod +x scripts/.local/bin/erase-disk.sh
|
||||
chmod +x scripts/.local/bin/update.sh
|
||||
chmod +x sway/.config/sway/autostart.sh
|
||||
chmod +x waybar/.config/waybar/ivpn-reconnect.sh
|
||||
|
|
|
@ -24,6 +24,7 @@ sleep 0.4
|
|||
echo "Making scripts executable..."
|
||||
|
||||
chmod +x scripts/.local/bin/clear-clipboard.sh
|
||||
chmod +x scripts/.local/bin/erase-disk.sh
|
||||
chmod +x scripts/.local/bin/update.sh
|
||||
|
||||
sleep 0.5
|
||||
|
|
19
scripts/.local/bin/erase-disk.sh
Executable file
19
scripts/.local/bin/erase-disk.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/dash
|
||||
# USAGE: erase-disk.sh <passes> <device>
|
||||
# Must be run as root
|
||||
|
||||
echo "# Securely erasing the disk device $2"
|
||||
|
||||
i=1
|
||||
|
||||
while [ $i -le $1 ]; do
|
||||
[ $i -eq 1 ] && if="/dev/urandom" || if="/dev/zero"
|
||||
|
||||
echo "\n- Begin pass $i with $if"
|
||||
dd if="$if" of="$2" status="progress"
|
||||
|
||||
echo "- Syncing I/O"
|
||||
sync
|
||||
|
||||
i=$(( i + 1 ))
|
||||
done
|
Loading…
Reference in a new issue