wfg / docker-openvpn-client

OpenVPN client with killswitch and proxy servers; built on Alpine
MIT License
353 stars 107 forks source link

Check to see script-security 2 is set. #21

Closed dngray closed 3 years ago

dngray commented 3 years ago

Your modified script changes these two lines

up /etc/openvpn/up.sh
down /etc/openvpn/down.sh

However these will not be executed unless script-security 2 is also added/uncommented.

if grep -Fxq "#script-security 2" input.conf
then
    sed -i "/#script-security 2=/c\script-security 2" $config_file_modified"
else
    echo "script-security 2" >> "$config_file_modified"
fi

It will cause an error when you try to start the VPN and the docker container will fail to stay up.

Edit:

Doesn't look like a check like this is required, because #script-security 2 already existed in my config, just needed uncommenting.

Did this exist in your config?