OpenVPN --up script - "could not execute external program"

I ran into the same issue, luckily I found a solution.

Here are things I checked:

  1. permission of folder
  2. permission of openvpn to access script
  3. the script must list the full path of any commands used (ex. grep should be /bin/grep; you can find the full path by typing which in front of your command)
  4. use script-security 2 system instead

Just to make it clear: I forgot the "!" (exclamation mark). That's explain everything.

#!/bin/bash