]> git.pld-linux.org Git - packages/openvpn.git/commitdiff
- upstart config
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 27 Jan 2011 21:57:38 +0000 (21:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    openvpn-tunnel.upstart -> 1.1
    openvpn.upstart -> 1.1

openvpn-tunnel.upstart [new file with mode: 0644]
openvpn.upstart [new file with mode: 0644]

diff --git a/openvpn-tunnel.upstart b/openvpn-tunnel.upstart
new file mode 100644 (file)
index 0000000..381e5da
--- /dev/null
@@ -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
diff --git a/openvpn.upstart b/openvpn.upstart
new file mode 100644 (file)
index 0000000..13abace
--- /dev/null
@@ -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
This page took 0.522941 seconds and 4 git commands to generate.