Adds pre-start for openvpn

This commit is contained in:
wilmardo
2019-02-04 21:52:27 +01:00
parent fa23f3154f
commit c23228bbfc
2 changed files with 9 additions and 0 deletions

View File

@@ -245,6 +245,7 @@ Once /scripts is mounted you'll need to write your custom code in the following
| Script | Function | | Script | Function |
|----------|----------| |----------|----------|
|/scripts/openvpn-pre-start.sh | This shell script will be executed before openvpn start |
|/scripts/transmission-pre-start.sh | This shell script will be executed before transmission start | |/scripts/transmission-pre-start.sh | This shell script will be executed before transmission start |
|/scripts/transmission-post-start.sh | This shell script will be executed after transmission start | |/scripts/transmission-post-start.sh | This shell script will be executed after transmission start |
|/scripts/transmission-pre-stop.sh | This shell script will be executed before transmission stop | |/scripts/transmission-pre-stop.sh | This shell script will be executed before transmission stop |

View File

@@ -13,6 +13,14 @@ fi
echo "Using OpenVPN provider: ${OPENVPN_PROVIDER}" echo "Using OpenVPN provider: ${OPENVPN_PROVIDER}"
# If openvpn-pre-start.sh exists, run it
if [ -x /scripts/openvpn-pre-start.sh ]
then
echo "Executing /scripts/openvpn-pre-start.sh"
/scripts/openvpn-pre-start.sh "$@"
echo "/scripts/openvpn-pre-start.sh returned $?"
fi
if [[ "$OPENVPN_PROVIDER" = "NORDVPN" ]] if [[ "$OPENVPN_PROVIDER" = "NORDVPN" ]]
then then
if [[ -z "$OPENVPN_CONFIG" ]] if [[ -z "$OPENVPN_CONFIG" ]]