diff --git a/README.md b/README.md index ed7a23dd9..6341d4b08 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ Once /scripts is mounted you'll need to write your custom code in the following | 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-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 | diff --git a/openvpn/start.sh b/openvpn/start.sh index 9f0fec08d..bdc8d822f 100755 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -13,6 +13,14 @@ fi 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" ]] then if [[ -z "$OPENVPN_CONFIG" ]]