-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
example.sh
executable file
·37 lines (31 loc) · 1.18 KB
/
example.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
###############################################################################
# Filename: example.sh
#
# Description: Example script for calling the get_secret function of
# encpass.sh. There are 3 ways to call the get_secret function
# listed below. Note, all the methods are equivalent.
#
###############################################################################
. encpass.sh
# METHOD 1: Call get_secret with no arguments (Default values are used)
# - default bucket name = <script name> (i.e. "example.sh")
# - default secret name = "password"
password=$(get_secret)
echo ""
echo "password=\$(get_secret)"
echo "password = $password"
echo ""
# METHOD 2: Call get_secret specifying a secret name
# - default bucket name = <script name> (i.e. "example.sh")
# - secret name = "password"
password=$(get_secret password)
echo "password=\$(get_secret password)"
echo "password = $password"
echo ""
# METHOD 3: Call get_secret specifying both a bucket name and a secret name
# - bucket name = "example.sh"
# - secret name = "password"
password=$(get_secret example.sh password)
echo "password=\$(get_secret example.sh password)"
echo "password = $password"