-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpgcat.sh
39 lines (37 loc) · 821 Bytes
/
gpgcat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# copy and paste these into your ~/.bashrc or whatever you source on terminal startup
# for the lazy bash users:
# $ curl https://raw.githubusercontent.com/alekratz/gpgcat/master/gpgcat.sh | grep '^[^#]' >> ~/.bashrc
# for the lazy zsh users:
# $ curl https://raw.githubusercontent.com/alekratz/gpgcat/master/gpgcat.sh | grep '^[^#] >> ~/.zshrc
function encat() {
case $# in
0)
echo "usage: $0 file [ file ... ]"
return 1
;;
1)
gpg -a -r YOUR_KEY_ID --encrypt < $1
;;
*)
for f in $@; do
echo "$f:"
gpg -a -r YOUR_KEY_ID --encrypt < $f
done
esac
}
function decat() {
case $# in
0)
echo "usage: $0 file [ file ... ]"
return 1
;;
1)
gpg -a --decrypt < $1
;;
*)
for f in $@; do
echo "$f:"
gpg -a --decrypt < $f
done
esac
}