Skip to content

Commit

Permalink
Rename cyphering scripts and improve usage function
Browse files Browse the repository at this point in the history
  • Loading branch information
ochurlaud committed Oct 19, 2019
1 parent 869bc82 commit 473c923
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions scripts/decrypt_dir.sh → scripts/decrypt_dir
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#! /bin/sh

PROGRAM_NAME=$(basename $0)

function usage() {
echo "Usage: decrypt_dir.sh INPUT OUTPUT"
echo "Usage: $PROGRAM_NAME INPUT OUTPUT"
exit $1
}

Expand All @@ -12,11 +14,9 @@ fi
if [[ "$#" -eq 2 ]] ; then
INPUT=$1
OUTPUT=$2
mkdir -p $2
openssl enc -d -aes-256-cbc -pbkdf2 -in $INPUT | tar xz -C $OUTPUT
mkdir -p $OUTPUT
gpgtar --decrypt -C $OUTPUT $INPUT
exit $?
fi

usage 1


7 changes: 4 additions & 3 deletions scripts/encrypt_dir.sh → scripts/encrypt_dir
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#! /bin/sh

PROGRAM_NAME=$(basename $0)

function usage() {
echo "Usage: encrypt_dir.sh INPUT OUTPUT"
echo "Usage: $PROGRAM_NAME INPUT OUTPUT"
exit $1
}

Expand All @@ -14,10 +16,9 @@ if [[ "$#" -eq 2 ]] ; then
OUTPUT=$2

cd $INPUT
tar -czf - * | openssl enc -e -aes-256-cbc -pbkdf2 -out $OUTPUT
gpgtar --symmetric --encrypt -o $OUTPUT *
cd -
exit $?
fi

usage 1

0 comments on commit 473c923

Please sign in to comment.