linux-surface/pkg/secrets/decrypt.sh
Dorian Stoll 6054395918
Fix issues more
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2020-01-09 23:28:48 +01:00

22 lines
289 B
Bash
Executable file

#!/bin/sh
PASS=""
FILE=""
while getopts ":p:f:" args; do
case "$args" in
p)
PASS=$OPTARG
;;
f)
FILE=$OPTARG
;;
esac
done
shift $((OPTIND-1))
OUTPUT=$(echo $FILE | sed 's/.gpg$//g')
gpg --quiet --no-tty --batch --yes --decrypt \
--passphrase="$PASS" --output $OUTPUT $FILE