Author: glen Date: Thu Jan 27 21:57:44 2011 GMT Module: packages Tag: HEAD ---- Log message: - upstart config
---- Files affected: packages/openvpn: openvpn-tunnel.upstart (NONE -> 1.1) (NEW), openvpn.upstart (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/openvpn/openvpn-tunnel.upstart diff -u /dev/null packages/openvpn/openvpn-tunnel.upstart:1.1 --- /dev/null Thu Jan 27 22:57:44 2011 +++ packages/openvpn/openvpn-tunnel.upstart Thu Jan 27 22:57:38 2011 @@ -0,0 +1,13 @@ +# openvpn tunnel daemon +# +# This service runs specified tunnel + +stop on pld.network-stopped + +manual + +#console output + +respawn +instance $TUNNEL +exec /usr/sbin/openvpn --config /etc/openvpn/$TUNNEL.conf --writepid /var/run/openvpn/$TUNNEL.pid --cd /etc/openvpn ================================================================ Index: packages/openvpn/openvpn.upstart diff -u /dev/null packages/openvpn/openvpn.upstart:1.1 --- /dev/null Thu Jan 27 22:57:44 2011 +++ packages/openvpn/openvpn.upstart Thu Jan 27 22:57:38 2011 @@ -0,0 +1,33 @@ +description "Start the OpenVPN tunnels" + +start on pld.network-started +stop on pld.network-stopped + +task +console output + +script + [ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn + + for tun in $TUNNELS; do + if [ ! -f "/etc/openvpn/$tun.conf" ]; then + # skip invalid tunnels + continue + fi + + initctl start openvpn-tunnel TUNNEL=$tun >/dev/null || : + done +end script + +pre-stop script + [ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn + + for tun in $TUNNELS; do + if [ ! -f "/etc/openvpn/$tun.conf" ]; then + # skip invalid tunnels + continue + fi + + initctl stop openvpn-tunnel TUNNEL=$tun >/dev/null || : + done +end script ================================================================ _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
