From 6b2ff5de7a85ac0dd21c4e6a3c6871099182d8ee Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sun, 13 Apr 2025 20:03:35 +0200 Subject: cle --- bin/crypt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'bin/crypt') diff --git a/bin/crypt b/bin/crypt index 939f3f5..c63d60a 100755 --- a/bin/crypt +++ b/bin/crypt @@ -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" -- cgit v1.2.3