Rename filter scripts

This commit is contained in:
Joey Hafner 2024-08-15 15:46:57 -07:00
parent 75b065de25
commit 492fa394d6
No known key found for this signature in database
2 changed files with 3 additions and 12 deletions

View File

@ -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 <file_path>"
# 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
sops --encrypt --age ${SOPS_AGE_RECIPIENTS} /dev/fd/3