Created
March 16, 2021 15:41
-
-
Save caiofaustino/f59fcab599dc2529317c43ac9c6313b5 to your computer and use it in GitHub Desktop.
Sign all files in folder recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Starting sign script" | |
script_path="/your/script/path/sign.sh" | |
if [ -d "$1" ]; then | |
echo "Path exists!" | |
for f in $1/*; do | |
if [[ $f == *"."[a-z][a-z][a-z] ]]; then | |
filename=$(basename "$f") | |
echo "Signing file - $filename" | |
gpg -ab --default-key <your_key> $f | |
else | |
echo "Starting script again with: $f" | |
$script_path "$f" | |
fi | |
done | |
else | |
echo "Path not found, please provide valid path as argument!" | |
fi | |
echo "Signing finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment