From 492fa394d6634f5d2294fdb1bfe65b71d78429d1 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 15 Aug 2024 15:46:57 -0700 Subject: [PATCH] Rename filter scripts --- .../{decrypt-in-place.sh => decrypt-filter.sh} | 0 .../{encrypt-in-place.sh => encrypt-filter.sh} | 15 +++------------ 2 files changed, 3 insertions(+), 12 deletions(-) rename homelab/.sops/{decrypt-in-place.sh => decrypt-filter.sh} (100%) rename homelab/.sops/{encrypt-in-place.sh => encrypt-filter.sh} (60%) diff --git a/homelab/.sops/decrypt-in-place.sh b/homelab/.sops/decrypt-filter.sh similarity index 100% rename from homelab/.sops/decrypt-in-place.sh rename to homelab/.sops/decrypt-filter.sh diff --git a/homelab/.sops/encrypt-in-place.sh b/homelab/.sops/encrypt-filter.sh similarity index 60% rename from homelab/.sops/encrypt-in-place.sh rename to homelab/.sops/encrypt-filter.sh index fdd8802a..cf8e799b 100755 --- a/homelab/.sops/encrypt-in-place.sh +++ b/homelab/.sops/encrypt-filter.sh @@ -1,11 +1,6 @@ #!/bin/bash -# Takes one file path as input -# Outputs to a new file named `$1.enc` - -# if [ "$#" -ne 1 ]; then -# echo "Usage: $0 " -# exit 1 -# fi +# Takes input on stdin +# Outputs to stdout # Set age directory and default recipients AGE_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) @@ -19,8 +14,4 @@ if [[ -f $HOST_AGE_PUBKEY ]]; then SOPS_AGE_RECIPIENTS="$SOPS_AGE_RECIPIENTS,$(<$HOST_AGE_PUBKEY)" fi -FILE_EXT=${FILE_PATH##*.} -FILE_NAME=${FILE_PATH%%.*} -OUTPUT_FILE="$FILE_NAME.enc.$FILE_EXT" - -sops --encrypt --age ${SOPS_AGE_RECIPIENTS} -i $FILE_PATH \ No newline at end of file +sops --encrypt --age ${SOPS_AGE_RECIPIENTS} /dev/fd/3 \ No newline at end of file