dotfiles/shell/functions.sh
2023-01-24 08:56:26 +01:00

14 lines
648 B
Bash

function secure_erase {
dd if=/dev/urandom of=/dev/$1 bs=1M status=progress
dd if=/dev/urandom of=/dev/$1 bs=1M status=progress
dd if=/dev/urandom of=/dev/$1 bs=1M status=progress
dd if=/dev/urandom of=/dev/$1 bs=1M status=progress
curl --location --request POST 'https://gotify.cat-enby.club/message' --header 'X-Gotify-Key: $GOTIFY_KEY' --header 'Content-Type: application/json' --data-raw '{
"appid": 1,
"message": "Disk /dev/$1 successfully erased",
"title": "secure_erase complete",
"date": "$(date +"%Y-%m-%d %T")",
"priority": 5
}'
echo "Disc /dev/$1 erased successfully"
}