Files
dotfiles/overlays/customscripts/src/agecrypt
2021-06-04 02:06:13 +05:30

19 lines
340 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 rage -o $TARGET $keys $FILE