From d2cd02d8e851dcee7277333e130f9881fab03e05 Mon Sep 17 00:00:00 2001 From: Linux User Date: Wed, 7 Jun 2023 10:56:13 +0000 Subject: [PATCH] image was renamed, vpn hash was addedd --- install.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 363474f..a110e28 100755 --- a/install.sh +++ b/install.sh @@ -33,12 +33,18 @@ ask_envs() { fi; fi - echo "VPN proxy? (y/N)"; + echo "VPN proxy? (Y/n)"; read -r ANSWER; - if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ]; then - VPN_PROXY="yes"; - else + if [ "$ANSWER" == "n" ] || [ "$ANSWER" == "N" ]; then VPN_PROXY="no"; + else + VPN_PROXY="yes"; + echo "Please add a valid vpn hash key:"; + while read -r VPN_HASH; do + if [ "$VPN_HASH" != "" ]; then + break; + fi; + done fi echo "Cron? (Y/n)"; @@ -134,6 +140,12 @@ check_dirs_and_files() { registry.format.hu/setup'"; } > $HOME/.bash_aliases + if [ "$VPN_HASH" != "" ]; then + $SUDO_CMD mkdir -p /etc/user/secret/vpn-proxy; + echo $VPN_HASH | base64 -d > /tmp/wg0.conf; + $SUDO_CMD mv /tmp/wg0.conf /etc/user/secret/vpn-proxy/; + fi + } check_running() { @@ -291,7 +303,7 @@ check_dirs_and_files; ask_envs; -$SUDO_CMD docker pull registry.format.hu/proxy-deployment-tool +$SUDO_CMD docker pull registry.format.hu/installer-tool $SUDO_CMD docker run \ --volume $HOME/.ssh/installer:/root/.ssh/id_rsa \ @@ -307,7 +319,7 @@ $SUDO_CMD docker run \ --volume /etc/system/:/etc/system/ \ --volume $DISCOVERY_DIR/:$DISCOVERY_DIR/ \ --volume $DISCOVERY_CONFIG_DIR/:$DISCOVERY_CONFIG_DIR/ \ ---env LETSENCRYPT_MAIL=$LETSENCRYPT_MAIL registry.format.hu/proxy-deployment-tool +--env LETSENCRYPT_MAIL=$LETSENCRYPT_MAIL registry.format.hu/installer-tool # test - alias doesn't work inside a function