File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # shellcheck source-path=SCRIPTDIR/../
4+
5+ # # Decrypt an encrypted ad-hoc variable.
6+
7+ # Load common tools
8+ CRYPTIC_REPO=" $( dirname " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) " ) "
9+ source " ${CRYPTIC_REPO} /lib/argparse.sh"
10+ source " ${CRYPTIC_REPO} /lib/common.sh"
11+
12+ # Get the repository root and private key
13+ find_repository_root
14+ find_private_key
15+
16+ # Read in encrypted value
17+ if [ " $# " -ge 1 ]; then
18+ ENCRYPTED_VALUE=" ${1} "
19+ else
20+ read -r -e -p " Encrypted value: " ENCRYPTED_VALUE
21+ fi
22+
23+ # Decrypt it
24+ DECRYPTED_VALUE=" $( decrypt_adhoc_value " ${AGENT_PRIVATE_KEY_PATH} " <<< " ${ENCRYPTED_VALUE}" ) "
25+
26+ # Print it
27+ cat << -EOD
28+
29+ Successfully decrypted the ad-hoc secret variable:
30+
31+ "${DECRYPTED_VALUE} "
32+ EOD
You can’t perform that action at this time.
0 commit comments