From 88a8ec4b6f04e0d67b2b6981c69be3cdb347d994 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Sat, 23 May 2026 09:10:30 -0600 Subject: [PATCH] sum updoots --- create-attributable-archive.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/create-attributable-archive.sh b/create-attributable-archive.sh index ac659d7..dff4700 100755 --- a/create-attributable-archive.sh +++ b/create-attributable-archive.sh @@ -8,7 +8,7 @@ signature_tag="file-integrity" out_dir="./out" inner_dir="$out_dir/contents" -checkcode () { +checkcode() { local retcode if [ -z "$1" ]; then echo -e "\n\e[31mERROR!\033[0m checkcode missing return code parameter\n" @@ -56,7 +56,7 @@ reset() { checkcode $? printf "making "$out_dir"/test_validate_passphrase.sh..." - cp test_validation_passphrase.txt "$out_dir/test_validate_passphrase.sh" + cp test_validate_passphrase.txt "$out_dir/test_validate_passphrase.sh" checkcode $? printf "making $out_dir/test_validate_passphrase.sh executable..." chmod +x "$out_dir/test_validate_passphrase.sh" @@ -67,6 +67,22 @@ reset() { printf "making $out_dir/verify-everything.sh executable"... chmod +x "$out_dir/verify-everything.sh" checkcode $? + + housekeeping_dirs=("archives" "keystore") + for dir in "${housekeeping_dirs[@]}"; do + printf "changing ownership of $dir to ${USER}..." + chown $USER:$USER -R "$dir" + checkcode $? + printf "changing permissions on $dir to 700..." + chmod 700 "$dir" + checkcode $? + printf "finding and shredding erroneous dirs in ${dir}..." + find "$dir" -mindepth 1 -type d -exec srm -r -z -l -l "{}" \; + checkcode $? + printf "changing perms of files in $dir to 600..." + find "$dir" -type f -exec chmod 600 "{}" \; + checkcode $? + done } printf "setting up environment..."