Added shell functions

This commit is contained in:
Nikurasu 2023-01-24 08:56:26 +01:00
parent ff953cea42
commit bb89fe5416
4 changed files with 21 additions and 1 deletions

3
.gitignore vendored
View file

@ -1 +1,2 @@
.DS_Store
.DS_Store
.env.sh

4
README.md Normal file
View file

@ -0,0 +1,4 @@
# Nikus Dotfiles
## Note for env.shell.example
Copy it and rename it to .env.sh. Don't commit one with your environment variables, that variables are secret keys

1
shell/env.sh.example Normal file
View file

@ -0,0 +1 @@
export GOTIFY_KEY=""

14
shell/functions.sh Normal file
View file

@ -0,0 +1,14 @@
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"
}