migration

This commit is contained in:
2026-05-26 20:50:50 -06:00
parent ca2a86493c
commit a28c575d60
2 changed files with 9 additions and 0 deletions
@@ -41,6 +41,15 @@ zero_delete_dir () {
rm -rf "$1"
}
# a function to securely zero out and unset a variable# wip;
secure_unset_var () {
truncate_str=$(printf "%600s" | sed 's/ /0/g') # 600 ascii zeros in a row
eval "\$$1=\"$truncate_str\"" # set the new var to the 600 zeros
eval "echo \$$1"
eval "unset \$$1" # unser string varname
unset truncate_str # unset zeros
}
# nuke file
## if shred is available, it zeros the file and deletes it, otherwise rm -f's it
shred -uz "$mytempfile" || rm -f "$mytempfile"