Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save darK-Zi0n-te4am-cr3vv/3308478 to your computer and use it in GitHub Desktop.
Save darK-Zi0n-te4am-cr3vv/3308478 to your computer and use it in GitHub Desktop.
Starting OpenVPN using Ubuntu Upstart
description "OpenVPN service instance"
author "C.c <ccik74@gmail.com>"
stop on runlevel [016]
respawn
instance $CONFIG_FILE
exec /usr/sbin/openvpn --config $CONFIG_FILE
description "OpenVPN service"
author "C.c <ccik74@gmail.com>"
# in my case OpenVPN using MySQL to obtain client IPs
start on (runlevel [2345] and started mysql)
stop on runlevel [016]
task
script
for conf in `ls /etc/openvpn/*.conf`
do
start openvpn-instance CONFIG_FILE=$conf
done
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment