Fix ovpn_genconfig to work in arm architecture

This commit is contained in:
Miguel Escriva 2017-12-22 14:25:26 +01:00
parent fd8daa133a
commit 00ec5214e0

View File

@ -178,13 +178,13 @@ while getopts ":a:e:E:C:T:r:s:du:bcp:n:k:DNm:f:tz2" opt; do
OVPN_AUTH="$OPTARG" OVPN_AUTH="$OPTARG"
;; ;;
e) e)
mapfile -t TMP_EXTRA_SERVER_CONFIG < <(echo "$OPTARG") mapfile -t TMP_EXTRA_SERVER_CONFIG <<< "$OPTARG"
for i in "${TMP_EXTRA_SERVER_CONFIG[@]}"; do for i in "${TMP_EXTRA_SERVER_CONFIG[@]}"; do
OVPN_EXTRA_SERVER_CONFIG+=("$i") OVPN_EXTRA_SERVER_CONFIG+=("$i")
done done
;; ;;
E) E)
mapfile -t TMP_EXTRA_CLIENT_CONFIG < <(echo "$OPTARG") mapfile -t TMP_EXTRA_CLIENT_CONFIG <<< "$OPTARG"
for i in "${TMP_EXTRA_CLIENT_CONFIG[@]}"; do for i in "${TMP_EXTRA_CLIENT_CONFIG[@]}"; do
OVPN_EXTRA_CLIENT_CONFIG+=("$i") OVPN_EXTRA_CLIENT_CONFIG+=("$i")
done done
@ -196,7 +196,7 @@ while getopts ":a:e:E:C:T:r:s:du:bcp:n:k:DNm:f:tz2" opt; do
OVPN_TLS_CIPHER="$OPTARG" OVPN_TLS_CIPHER="$OPTARG"
;; ;;
r) r)
mapfile -t TMP_ROUTES < <(echo "$OPTARG") mapfile -t TMP_ROUTES <<< "$OPTARG"
for i in "${TMP_ROUTES[@]}"; do for i in "${TMP_ROUTES[@]}"; do
OVPN_ROUTES+=("$i") OVPN_ROUTES+=("$i")
done done
@ -218,13 +218,13 @@ while getopts ":a:e:E:C:T:r:s:du:bcp:n:k:DNm:f:tz2" opt; do
OVPN_CLIENT_TO_CLIENT=1 OVPN_CLIENT_TO_CLIENT=1
;; ;;
p) p)
mapfile -t TMP_PUSH < <(echo "$OPTARG") mapfile -t TMP_PUSH <<< "$OPTARG"
for i in "${TMP_PUSH[@]}"; do for i in "${TMP_PUSH[@]}"; do
OVPN_PUSH+=("$i") OVPN_PUSH+=("$i")
done done
;; ;;
n) n)
mapfile -t TMP_DNS_SERVERS < <(echo "$OPTARG") mapfile -t TMP_DNS_SERVERS <<< "$OPTARG"
for i in "${TMP_DNS_SERVERS[@]}"; do for i in "${TMP_DNS_SERVERS[@]}"; do
OVPN_DNS_SERVERS+=("$i") OVPN_DNS_SERVERS+=("$i")
done done
@ -299,9 +299,9 @@ if [ -f "$OVPN_ENV" ]; then
fi fi
# Save the current OVPN_ vars to the ovpn_env.sh file # Save the current OVPN_ vars to the ovpn_env.sh file
while read -r var; do (set | grep '^OVPN_') | while read -r var; do
echo "declare -x $var" >> "$OVPN_ENV" echo "declare -x $var" >> "$OVPN_ENV"
done < <(set | grep '^OVPN_') done
conf=${OPENVPN:-}/openvpn.conf conf=${OPENVPN:-}/openvpn.conf
if [ -f "$conf" ]; then if [ -f "$conf" ]; then