From 2bab2edf43b0de606d445b1859306d1d6b2500f5 Mon Sep 17 00:00:00 2001 From: Patrick Skowronek Date: Mon, 28 Mar 2022 15:34:57 +0200 Subject: [PATCH] Added script for basic auth user --- lib/add_bc_user.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 lib/add_bc_user.sh diff --git a/lib/add_bc_user.sh b/lib/add_bc_user.sh new file mode 100755 index 0000000..a7442be --- /dev/null +++ b/lib/add_bc_user.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e + +echo "This script add's a user with password to the bridghead" +read -p 'Username: ' bc_user +read -sp 'Password: ' bc_password + +echo + +bc=$(docker run --rm -ti xmartlabs/htpasswd $bc_user $bc_password) + +if [ -z $bc_auth_users ]; then + export bc_auth_users=$bc + echo $bc_auth_users +else + export bc_auth_users="$bc_auth_users,$bc" + echo $bc_auth_users +fi +