migration
This commit is contained in:
@@ -41,6 +41,15 @@ zero_delete_dir () {
|
|||||||
rm -rf "$1"
|
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
|
# nuke file
|
||||||
## if shred is available, it zeros the file and deletes it, otherwise rm -f's it
|
## if shred is available, it zeros the file and deletes it, otherwise rm -f's it
|
||||||
shred -uz "$mytempfile" || rm -f "$mytempfile"
|
shred -uz "$mytempfile" || rm -f "$mytempfile"
|
||||||
|
|||||||
Reference in New Issue
Block a user