uses bash
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
bold=$(tput bold)
|
bold=$(tput bold)
|
||||||
normal=$(tput sgr0)
|
normal=$(tput sgr0)
|
||||||
@@ -29,19 +29,18 @@ provider=$1
|
|||||||
|
|
||||||
for configFile in $provider/*.ovpn;
|
for configFile in $provider/*.ovpn;
|
||||||
do
|
do
|
||||||
if [[ -h ${configFile} ]];
|
if [[ -L ${configFile} ]]; then
|
||||||
then
|
|
||||||
continue # Don't edit symbolic links (default.ovpn)
|
continue # Don't edit symbolic links (default.ovpn)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Absolute reference to ca cert
|
# Absolute reference to ca cert
|
||||||
sed -i '' "s/ca .*\.crt/ca \/etc\/openvpn\/$provider\/ca.crt/g" "$configFile"
|
sed -i "s/ca .*\.crt/ca \/etc\/openvpn\/$provider\/ca.crt/g" "$configFile"
|
||||||
|
|
||||||
# Absolute reference to crl
|
# Absolute reference to crl
|
||||||
sed -i '' "s/crl-verify.*\.pem/crl-verify \/etc\/openvpn\/$provider\/crl.pem/g" "$configFile"
|
sed -i "s/crl-verify.*\.pem/crl-verify \/etc\/openvpn\/$provider\/crl.pem/g" "$configFile"
|
||||||
|
|
||||||
# Set user-pass file location
|
# Set user-pass file location
|
||||||
sed -i '' "s/auth-user-pass.*/auth-user-pass \/config\/openvpn-credentials.txt/g" "$configFile"
|
sed -i "s/auth-user-pass.*/auth-user-pass \/config\/openvpn-credentials.txt/g" "$configFile"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user