Files
dotfiles/overlays/customscripts/src/agecrypt

20 lines
367 B
Plaintext

#!/usr/bin/env nix-shell
#! nix-shell -i bash -p rage
if [ $# -eq 0 ]; then echo "bruh"; exit 1; fi
FILE=$1
if [ $# -eq 2 ]; then
TARGET="$2.age"
elif [ $# -eq 1 ]; then
TARGET="$FILE.age"
else
echo "bruh"
exit 1
fi
keys=""
for x in ~/.ssh/*.pub
do
keys= "$keys -r $(cat 'x')"
done
echo "Encrypting with \n'$keys'"
rage -o "$TARGET" "$keys" "$1"