linux-surface/pkg/secret/decrypt.sh
Dorian Stoll fe581136f7
Add secrets
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2020-01-09 23:23:18 +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