mirror of
https://github.com/luxfi/safe-ios.git
synced 2026-10-30 15:19:20 +00:00
19 lines
363 B
Bash
Executable File
19 lines
363 B
Bash
Executable File
#! /usr/bin/env bash
|
|
set -e +o pipefail
|
|
|
|
KEY="$1"
|
|
INPUT="$2"
|
|
OUTPUT="$3"
|
|
|
|
TEMP="$OUTPUT.tar"
|
|
|
|
if [ -z ${KEY} ] || [ ! -f "${INPUT}" ] ; then
|
|
# if decryption key is not set or input file does not exist, skip this.
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p "${OUTPUT}"
|
|
openssl aes-256-cbc -k "${KEY}" -in "${INPUT}" -out "${TEMP}" -d
|
|
tar xf "${TEMP}" -C "${OUTPUT}"
|
|
rm -rf "${TEMP}"
|