Fixed some non-standard syntax

master
Meliurwen 4 years ago
parent 311afb19ce
commit f5150f759b
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 10
      bin/openvpn-initialize
  2. 1
      bin/openvpn-menu
  3. 9
      bin/start.sh

@ -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

@ -17,7 +17,6 @@ function tunAvailable () {
function checkOS () {
if [[ -e /etc/debian_version ]]; then
OS="debian"
source /etc/os-release
if [[ "$ID" == "debian" ]]; then

@ -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

Loading…
Cancel
Save