diff options
| author | Marc Vertes <mvertes@free.fr> | 2025-04-13 20:03:35 +0200 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2025-04-13 20:03:35 +0200 |
| commit | 6b2ff5de7a85ac0dd21c4e6a3c6871099182d8ee (patch) | |
| tree | 11bbe9b8aab723098756c5977fb3ef5c0cebe409 /bin/crypt | |
| parent | b7927432c7574abb47425fd1af5e7d8ab8fc936c (diff) | |
cle
Diffstat (limited to 'bin/crypt')
| -rwxr-xr-x | bin/crypt | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,13 +1,12 @@ #!/bin/sh -usage='Usage: crypt [-de] [-o output] [input] +usage='Usage: crypt [-d] [-o output] [input] Encrypt or decrypt input (default: stdin) to ouput (default: stdout), using ssh rsa key. Options: -d action is decrypt (default: encrypt) - -e action is encrypt -o output set ouput (default: stdout)' key="$(mktemp)" @@ -40,14 +39,13 @@ decrypt() { } cmd=encrypt -while getopts :deo: opt; do +while getopts :do: opt; do case $opt in d) cmd=decrypt ;; - e) cmd=encrypt ;; o) exec 1>"$OPTARG" ;; *) echo "$usage" >&2; exit 1 ;; esac done shift $((OPTIND - 1)) -[ "$1" ] && [ "$1" != "-" ] && exec 0<"$1" +[ "$1" ] && exec 0<"$1" "$cmd" |
