diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-04-16 10:53:57 +0000 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-04-19 02:45:27 +0200 |
commit | f1d7f500ac51057bb3337fa2945f5b0cbd93ec6a (patch) | |
tree | 692987d90425fced480884ba00c6499b007bcf8f /meta-networking/recipes-support/openvpn | |
parent | 21adc5d117329b11fa42da2f62edce3cad8719ff (diff) | |
download | meta-openembedded-f1d7f500ac51057bb3337fa2945f5b0cbd93ec6a.tar.gz |
openvpn: move to meta-networking and tweak
* Move SRC_URI checksums next to SRC_URI
* Move packaging definitions to the end
* Set SUMMARY instead of DESCRIPTION
* Drop unused inc file
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/openvpn')
-rwxr-xr-x | meta-networking/recipes-support/openvpn/openvpn/openvpn | 104 | ||||
-rw-r--r-- | meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb | 27 |
2 files changed, 131 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/openvpn/openvpn/openvpn b/meta-networking/recipes-support/openvpn/openvpn/openvpn new file mode 100755 index 000000000..a3cd6a2f4 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn/openvpn | |||
@@ -0,0 +1,104 @@ | |||
1 | #!/bin/sh -e | ||
2 | # | ||
3 | # Original version by Robert Leslie | ||
4 | # <rob@mars.org>, edited by iwj and cs | ||
5 | # Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as> | ||
6 | # Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net> | ||
7 | |||
8 | test $DEBIAN_SCRIPT_DEBUG && set -v -x | ||
9 | |||
10 | DAEMON=/usr/sbin/openvpn | ||
11 | CONFIG_DIR=/etc/openvpn | ||
12 | test -x $DAEMON || exit 0 | ||
13 | test -d $CONFIG_DIR || exit 0 | ||
14 | |||
15 | start_vpn () { | ||
16 | modprobe tun >/dev/null 2>&1 || true | ||
17 | $DAEMON --daemon --writepid /var/run/openvpn.$NAME.pid \ | ||
18 | --config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || echo -n " FAILED->" | ||
19 | echo -n " $NAME" | ||
20 | } | ||
21 | stop_vpn () { | ||
22 | kill `cat $PIDFILE` || true | ||
23 | rm $PIDFILE | ||
24 | } | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | echo -n "Starting openvpn:" | ||
29 | |||
30 | if test -z $2 ; then | ||
31 | for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do | ||
32 | NAME=${CONFIG%%.conf} | ||
33 | start_vpn | ||
34 | done | ||
35 | else | ||
36 | if test -e $CONFIG_DIR/$2.conf ; then | ||
37 | NAME=$2 | ||
38 | start_vpn | ||
39 | else | ||
40 | echo -n " No such VPN: $2" | ||
41 | fi | ||
42 | fi | ||
43 | echo "." | ||
44 | |||
45 | ;; | ||
46 | stop) | ||
47 | echo -n "Stopping openvpn:" | ||
48 | |||
49 | if test -z $2 ; then | ||
50 | for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do | ||
51 | NAME=`echo $PIDFILE | cut -c18-` | ||
52 | NAME=${NAME%%.pid} | ||
53 | stop_vpn | ||
54 | echo -n " $NAME" | ||
55 | done | ||
56 | else | ||
57 | if test -e /var/run/openvpn.$2.pid ; then | ||
58 | PIDFILE=`ls /var/run/openvpn.$2.pid 2> /dev/null` | ||
59 | NAME=`echo $PIDFILE | cut -c18-` | ||
60 | NAME=${NAME%%.pid} | ||
61 | stop_vpn | ||
62 | echo -n " $NAME" | ||
63 | else | ||
64 | echo -n " No such VPN: $2" | ||
65 | fi | ||
66 | fi | ||
67 | echo "." | ||
68 | ;; | ||
69 | # We only 'reload' for running VPNs. New ones will only start with 'start' or 'restart'. | ||
70 | reload|force-reload) | ||
71 | echo -n "Reloading openvpn:" | ||
72 | for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do | ||
73 | NAME=`echo $PIDFILE | cut -c18-` | ||
74 | NAME=${NAME%%.pid} | ||
75 | # If openvpn if running under a different user than root we'll need to restart | ||
76 | if egrep '^( |\t)*user' $CONFIG_DIR/$NAME.conf > /dev/null 2>&1 ; then | ||
77 | stop_vpn | ||
78 | sleep 1 | ||
79 | start_vpn | ||
80 | echo -n "(restarted)" | ||
81 | else | ||
82 | kill -HUP `cat $PIDFILE` || true | ||
83 | # start-stop-daemon --stop --signal HUP --quiet --oknodo \ | ||
84 | # --exec $DAEMON --pidfile $PIDFILE | ||
85 | echo -n " $NAME" | ||
86 | fi | ||
87 | done | ||
88 | echo "." | ||
89 | ;; | ||
90 | |||
91 | restart) | ||
92 | $0 stop $2 | ||
93 | sleep 1 | ||
94 | $0 start $2 | ||
95 | ;; | ||
96 | *) | ||
97 | echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2 | ||
98 | exit 1 | ||
99 | ;; | ||
100 | esac | ||
101 | |||
102 | exit 0 | ||
103 | |||
104 | # vim:set ai et sts=2 sw=2 tw=0: | ||
diff --git a/meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb b/meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb new file mode 100644 index 000000000..f58756e08 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb | |||
@@ -0,0 +1,27 @@ | |||
1 | SUMMARY = "A full-featured SSL VPN solution via tun device." | ||
2 | HOMEPAGE = "http://openvpn.sourceforge.net" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=5aac200199fde47501876cba7263cb0c" | ||
6 | DEPENDS = "lzo openssl" | ||
7 | |||
8 | inherit autotools | ||
9 | |||
10 | SRC_URI = "http://openvpn.net/release/openvpn-${PV}.tar.gz \ | ||
11 | file://openvpn" | ||
12 | |||
13 | SRC_URI[md5sum] = "7486d3e270ba4b033e311d3e022a0ad7" | ||
14 | SRC_URI[sha256sum] = "5185181df2e6043bd667377bc92e36ea5a5bd7600af209654f109b6403ca5b36" | ||
15 | |||
16 | CFLAGS += "-fno-inline" | ||
17 | |||
18 | # I want openvpn to be able to read password from file (hrw) | ||
19 | EXTRA_OECONF += "--enable-password-save" | ||
20 | |||
21 | do_install_append() { | ||
22 | install -d ${D}/${sysconfdir}/init.d | ||
23 | install -d ${D}/${sysconfdir}/openvpn | ||
24 | install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d | ||
25 | } | ||
26 | |||
27 | RRECOMMENDS_${PN} = "kernel-module-tun" | ||