From f5150f759b495cfcaea5a7fe5801ace846bd9a08 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Thu, 20 Aug 2020 16:32:44 +0200 Subject: [PATCH] Fixed some non-standard syntax --- bin/openvpn-initialize | 10 +++++----- bin/openvpn-menu | 1 - bin/start.sh | 9 +++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/openvpn-initialize b/bin/openvpn-initialize index ea1d73f..3bf40b4 100644 --- a/bin/openvpn-initialize +++ b/bin/openvpn-initialize @@ -82,7 +82,7 @@ initializeOpenVPN () { rm -f ~/EasyRSA-unix-v${version}.tgz - cd /etc/openvpn/easy-rsa/ + cd /etc/openvpn/easy-rsa/ || exit echo "set_var EASYRSA_ALGO ec" > vars echo "set_var EASYRSA_CURVE $CERT_CURVE" >> vars @@ -144,10 +144,10 @@ push "redirect-gateway ipv6"' >> /etc/openvpn/server.conf - echo "dh none" >> /etc/openvpn/server.conf - echo "ecdh-curve $DH_CURVE" >> /etc/openvpn/server.conf - echo "tls-crypt tls-crypt.key 0" >> /etc/openvpn/server.conf - echo "crl-verify crl.pem + echo "dh none +ecdh-curve $DH_CURVE +tls-crypt tls-crypt.key 0 +crl-verify crl.pem ca ca.crt cert $SERVER_NAME.crt key $SERVER_NAME.key diff --git a/bin/openvpn-menu b/bin/openvpn-menu index f1c5dae..f443099 100644 --- a/bin/openvpn-menu +++ b/bin/openvpn-menu @@ -17,7 +17,6 @@ function tunAvailable () { function checkOS () { if [[ -e /etc/debian_version ]]; then - OS="debian" source /etc/os-release if [[ "$ID" == "debian" ]]; then diff --git a/bin/start.sh b/bin/start.sh index 7730d0b..6dde210 100644 --- a/bin/start.sh +++ b/bin/start.sh @@ -24,7 +24,7 @@ OPENVPN_CONFIG_FILE=/etc/openvpn/server.conf if [ -z $DNS1 ]; then echo "DNS1 env variable not set, setting as deafault Cloudflare's 1.1.1.1" - $DNS1 = '1.1.1.1' + DNS1='1.1.1.1' sed -i -e 's/"dhcp-option DNS .*"/"dhcp-option DNS '${DNS1}'"/g' ${OPENVPN_CONFIG_FILE} else @@ -37,7 +37,7 @@ else DNS1=$(host pihole | grep -oE "\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b") - if [ ! -z $DNS1 ]; then + if [ ! -z "$DNS1" ]; then echo "The DNS1 container address is ${DNS1}" sed -i -e 's/"dhcp-option DNS .*"/"dhcp-option DNS '${DNS1}'"/g' ${OPENVPN_CONFIG_FILE} else @@ -59,7 +59,8 @@ fi # Get the \"public\" interface from the default route -export NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1) +NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1) +export NIC # Add iptable rules if [[ "$DNS_ONLY" = 'y' ]]; then @@ -68,7 +69,7 @@ else add-openvpn-ipv4-rules fi -if [ '$IPV6_SUPPORT' = 'y' ]; then +if [ "$IPV6_SUPPORT" = 'y' ]; then add-openvpn-ipv6-rules fi