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 38
|
#!/bin/sh
set -e
set -x
usage () {
echo "Usage: $0 --hostname <HOSTNAME> --root-password <ROOT_PASSWORD>"
exit 1
}
for i in $@ ; do
case "${1}" in
"--hostname")
HOSTNAME=${2}
shift
shift
;;
"--root-password")
ROOT_PASSWORD=${2}
shift
shift
;;
*)
;;
esac
done
if [ -z "${HOSTNAME}" ] ; then
usage
fi
if [ -z "${ROOT_PASSWORD}" ] ; then
usage
fi
SHORT_HOSTNAME=$(echo ${HOSTNAME} | cut -d. -f1)
vault kv put common/wallet/${SHORT_HOSTNAME} root=${ROOT_PASSWORD}
|