cleanup
This commit is contained in:
@@ -1,32 +1,60 @@
|
||||
#!/bin/bash
|
||||
echo "autoshredding these files:"
|
||||
find . -type f \( -path ".git" -o -path "keystore" -o -path "archives" \) -prune \( -name "*.sha512" -o -name "checksums*" -o -name "private_*" -o -name ".*" -o -name "*.sig" -o -name "*.7z" -o -name "anonymous_signer" \) -print -exec shred -uz {} \;
|
||||
echo $?
|
||||
|
||||
echo "nuking errant priv key files"
|
||||
checkcode () {
|
||||
local retcode
|
||||
if [ -z "$1" ]; then
|
||||
echo -e "\n\e[31mERROR!\033[0m checkcode missing return code parameter\n"
|
||||
exit 1
|
||||
else
|
||||
retcode=$1
|
||||
fi
|
||||
|
||||
if [ $retcode -ne 0 ]; then
|
||||
echo -e "\e[31mERROR!\033[0m Response Code: $retcode"
|
||||
else
|
||||
printf '\e[1;32mOK!\e[0m\n'
|
||||
fi
|
||||
}
|
||||
|
||||
printf "autoshredding these files:"
|
||||
find . -type f \( -path ".git" -o -path "keystore" -o -path "archives" \) -prune \( -name "*.sha512" -o -name "checksums*" -o -name "private_*" -o -name ".*" -o -name "*.sig" -o -name "*.7z" -o -name "anonymous_signer" \) -print -exec shred -uz {} \;
|
||||
checkcode $?
|
||||
|
||||
printf "nuking errant priv key files"
|
||||
shred -uz private_*
|
||||
echo $?
|
||||
checkcode $?
|
||||
shred -uz *.pub
|
||||
echo $?
|
||||
checkcode $?
|
||||
shred -uz attribution_passphrase_*
|
||||
echo $?
|
||||
checkcode $?
|
||||
|
||||
echo "autoshredding out"
|
||||
srm -r -z -l -l ./out
|
||||
echo $?
|
||||
checkcode $?
|
||||
|
||||
echo "rebuilding out"
|
||||
printf "making out dir structure"
|
||||
mkdir -p out/contents
|
||||
echo $?
|
||||
checkcode $?
|
||||
printf "updating out/contents/READMD.md"
|
||||
echo "put files to verifiably archive in here" > out/contents/README.md
|
||||
checkcode $?
|
||||
printf "updating out/README.md"
|
||||
echo "# todo: make this nice" > ./out/README.md
|
||||
checkcode $?
|
||||
|
||||
printf "making out/test_validate_passphrase.sh"
|
||||
cp test_validation_passphrase.txt out/test_validate_passphrase.sh
|
||||
echo $?
|
||||
checkcode $?
|
||||
printf "making out/test_validate_passphrase.sh executable"
|
||||
chmod +x out/test_validate_passphrase.sh
|
||||
echo $?
|
||||
checkcode $?
|
||||
printf "making out/verify-everything.sh"
|
||||
cp verify-everything.txt out/verify-everything.sh
|
||||
echo $?
|
||||
checkcode $?
|
||||
printf "making out/verify-everything.sh executable"
|
||||
chmod +x out/verify-everything.sh
|
||||
echo $?
|
||||
echo done :3
|
||||
checkcode $?
|
||||
|
||||
echo -e "\n\ndone :3\n\n"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user