wok-current rev 16412
Up: openvpn (2.3.3), added openvpn-doc, added initscript (TEST AND FIX, PLEASE)
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Thu Apr 17 14:01:12 2014 +0400 (2014-04-17) |
parents | ad47999f35d7 |
children | bfe2f28f9699 3d798b112634 |
files | openvpn-doc/receipt openvpn-down-root/receipt openvpn-pam/receipt openvpn/receipt openvpn/stuff/etc/init.d/openvpn-client openvpn/stuff/etc/init.d/openvpn-server openvpn/stuff/etc/openvpn/openvpn.conf |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/openvpn-doc/receipt Thu Apr 17 14:01:12 2014 +0400 1.3 @@ -0,0 +1,25 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="openvpn-doc" 1.7 +VERSION="2.3.3" 1.8 +CATEGORY="network" 1.9 +SHORT_DESC="Documentation for OpenVPN." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +LICENSE="GPL2" 1.12 +WEB_SITE="http://openvpn.net/" 1.13 +TAGS="vpn tunnel" 1.14 +HOST_ARCH="i486 arm" 1.15 + 1.16 +WANTED="openvpn" 1.17 +DEPENDS="openvpn" 1.18 + 1.19 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.20 +genpkg_rules() 1.21 +{ 1.22 + mkdir -p $fs/usr/share/openvpn 1.23 + cp -a $install/usr/share/ $fs/usr/ 1.24 + cp -a $src/sample/sample-config-files $fs/usr/share/openvpn 1.25 + cp -a $src/sample/sample-plugins $fs/usr/share/openvpn 1.26 + cp -a $src/sample/sample-keys $fs/usr/share/openvpn 1.27 + cp -a $src/sample/sample-scripts $fs/usr/share/openvpn 1.28 +}
2.1 --- a/openvpn-down-root/receipt Thu Apr 17 11:15:22 2014 +0400 2.2 +++ b/openvpn-down-root/receipt Thu Apr 17 14:01:12 2014 +0400 2.3 @@ -1,7 +1,7 @@ 2.4 # SliTaz package receipt. 2.5 2.6 PACKAGE="openvpn-down-root" 2.7 -VERSION="2.3.2" 2.8 +VERSION="2.3.3" 2.9 CATEGORY="network" 2.10 SHORT_DESC="The down-root plugin for OpenVPN." 2.11 MAINTAINER="pascal.bellard@slitaz.org"
3.1 --- a/openvpn-pam/receipt Thu Apr 17 11:15:22 2014 +0400 3.2 +++ b/openvpn-pam/receipt Thu Apr 17 14:01:12 2014 +0400 3.3 @@ -1,7 +1,7 @@ 3.4 # SliTaz package receipt. 3.5 3.6 PACKAGE="openvpn-pam" 3.7 -VERSION="2.3.2" 3.8 +VERSION="2.3.3" 3.9 CATEGORY="network" 3.10 SHORT_DESC="PAM plugin for OpenVPN." 3.11 MAINTAINER="pascal.bellard@slitaz.org"
4.1 --- a/openvpn/receipt Thu Apr 17 11:15:22 2014 +0400 4.2 +++ b/openvpn/receipt Thu Apr 17 14:01:12 2014 +0400 4.3 @@ -1,7 +1,7 @@ 4.4 # SliTaz package receipt. 4.5 4.6 PACKAGE="openvpn" 4.7 -VERSION="2.3.2" 4.8 +VERSION="2.3.3" 4.9 CATEGORY="network" 4.10 SHORT_DESC="Full-featured open source SSL VPN solution." 4.11 MAINTAINER="pascal.bellard@slitaz.org" 4.12 @@ -34,12 +34,15 @@ 4.13 { 4.14 mkdir -p $fs/usr/sbin 4.15 cp -a $install/usr/sbin/openvpn $fs/usr/sbin 4.16 + cp -a $stuff/etc $fs 4.17 + chown root.root $fs/etc/init.d/* 4.18 + chmod 0644 $fs/etc/openvpn/openvpn.conf 4.19 } 4.20 4.21 # Post install/remove commands for Tazpkg. 4.22 post_install() 4.23 { 4.24 - mkdir -p ${root}/etc/openvpn ${root}/var/run/openvpn 4.25 + mkdir -p ${root}/var/run/openvpn 4.26 } 4.27 4.28 post_remove()
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/openvpn/stuff/etc/init.d/openvpn-client Thu Apr 17 14:01:12 2014 +0400 5.3 @@ -0,0 +1,77 @@ 5.4 +#!/bin/sh 5.5 +# /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot 5.6 +# time or with the command line. 5.7 +# 5.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 5.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 5.10 +# 5.11 +. /etc/init.d/rc.functions 5.12 +. /etc/daemons.conf 5.13 + 5.14 +NAME=OpenVPN 5.15 +DESC="VPN daemon" 5.16 +DAEMON=/usr/sbin/openvpn 5.17 +OPTIONS=$OPENVPN_OPTIONS 5.18 +PIDFILE=/var/run/rsyncd.pid 5.19 + 5.20 +checktundevice() { 5.21 + if [ ! -e /dev/net/tun ]; then 5.22 + if ! modprobe tun ; then 5.23 + echo -n "TUN/TAP support is not available in this kernel" 5.24 + return 1 5.25 + fi 5.26 + fi 5.27 + if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then 5.28 + echo -n "Detected broken /dev/net/tun symlink, fixing..." 5.29 + rm -f /dev/net/tun 5.30 + ln -s /dev/misc/net/tun /dev/net/tun 5.31 + fi 5.32 +} 5.33 + 5.34 +case "$1" in 5.35 + start) 5.36 + checktundevice 5.37 + 5.38 + if [ ! -e /etc/openvpn/client.conf ]; then 5.39 + echo "Missing OpenVPN client config." 5.40 + exit 1 5.41 + fi 5.42 + if active_pidfile $PIDFILE openvpn ; then 5.43 + echo "$NAME already running." 5.44 + exit 1 5.45 + fi 5.46 + echo -n "Starting $DESC: $NAME... " 5.47 + $DAEMON --client $OPTIONS 5.48 + status 5.49 + ;; 5.50 + stop) 5.51 + if ! active_pidfile $PIDFILE openvpn ; then 5.52 + echo "$NAME is not running." 5.53 + exit 1 5.54 + fi 5.55 + echo -n "Stopping $DESC: $NAME... " 5.56 + kill `cat $PIDFILE` 5.57 + rm $PIDFILE 5.58 + status 5.59 + ;; 5.60 + restart) 5.61 + if ! active_pidfile $PIDFILE openvpn ; then 5.62 + echo "$NAME is not running." 5.63 + exit 1 5.64 + fi 5.65 + echo -n "Restarting $DESC: $NAME... " 5.66 + kill `cat $PIDFILE` 5.67 + rm $PIDFILE 5.68 + sleep 2 5.69 + $DAEMON --client $OPTIONS 5.70 + status 5.71 + ;; 5.72 + *) 5.73 + echo "" 5.74 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 5.75 + echo "" 5.76 + exit 1 5.77 + ;; 5.78 +esac 5.79 + 5.80 +exit 0
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/openvpn/stuff/etc/init.d/openvpn-server Thu Apr 17 14:01:12 2014 +0400 6.3 @@ -0,0 +1,77 @@ 6.4 +#!/bin/sh 6.5 +# /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot 6.6 +# time or with the command line. 6.7 +# 6.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 6.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 6.10 +# 6.11 +. /etc/init.d/rc.functions 6.12 +. /etc/daemons.conf 6.13 + 6.14 +NAME=OpenVPN 6.15 +DESC="VPN daemon" 6.16 +DAEMON=/usr/sbin/openvpn 6.17 +OPTIONS=$OPENVPN_OPTIONS 6.18 +PIDFILE=/var/run/rsyncd.pid 6.19 + 6.20 +checktundevice() { 6.21 + if [ ! -e /dev/net/tun ]; then 6.22 + if ! modprobe tun ; then 6.23 + echo -n "TUN/TAP support is not available in this kernel" 6.24 + return 1 6.25 + fi 6.26 + fi 6.27 + if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then 6.28 + echo -n "Detected broken /dev/net/tun symlink, fixing..." 6.29 + rm -f /dev/net/tun 6.30 + ln -s /dev/misc/net/tun /dev/net/tun 6.31 + fi 6.32 +} 6.33 + 6.34 +case "$1" in 6.35 + start) 6.36 + checktundevice 6.37 + 6.38 + if [ ! -e /etc/openvpn/server.conf ]; then 6.39 + echo "Missing OpenVPN server config." 6.40 + exit 1 6.41 + fi 6.42 + if active_pidfile $PIDFILE openvpn ; then 6.43 + echo "$NAME already running." 6.44 + exit 1 6.45 + fi 6.46 + echo -n "Starting $DESC: $NAME... " 6.47 + $DAEMON $OPTIONS 6.48 + status 6.49 + ;; 6.50 + stop) 6.51 + if ! active_pidfile $PIDFILE openvpn ; then 6.52 + echo "$NAME is not running." 6.53 + exit 1 6.54 + fi 6.55 + echo -n "Stopping $DESC: $NAME... " 6.56 + kill `cat $PIDFILE` 6.57 + rm $PIDFILE 6.58 + status 6.59 + ;; 6.60 + restart) 6.61 + if ! active_pidfile $PIDFILE openvpn ; then 6.62 + echo "$NAME is not running." 6.63 + exit 1 6.64 + fi 6.65 + echo -n "Restarting $DESC: $NAME... " 6.66 + kill `cat $PIDFILE` 6.67 + rm $PIDFILE 6.68 + sleep 2 6.69 + $DAEMON $OPTIONS 6.70 + status 6.71 + ;; 6.72 + *) 6.73 + echo "" 6.74 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 6.75 + echo "" 6.76 + exit 1 6.77 + ;; 6.78 +esac 6.79 + 6.80 +exit 0
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/openvpn/stuff/etc/openvpn/openvpn.conf Thu Apr 17 14:01:12 2014 +0400 7.3 @@ -0,0 +1,18 @@ 7.4 +# OpenVPN automatically creates an /etc/resolv.conf (or sends it to 7.5 +# resolvconf) if given DNS information by the OpenVPN server. 7.6 +# Set PEER_DNS="no" to stop this. 7.7 +PEER_DNS="yes" 7.8 + 7.9 +# OpenVPN can run in many modes. Most people will want the init script 7.10 +# to automatically detect the mode and try and apply a good default 7.11 +# configuration and setup scripts. However, there are cases where the 7.12 +# OpenVPN configuration looks like a client, but it's really a peer or 7.13 +# something else. DETECT_CLIENT controls this behaviour. 7.14 +DETECT_CLIENT="yes" 7.15 + 7.16 +# If DETECT_CLIENT is no and you have your own scripts to re-enter the openvpn 7.17 +# init script (ie, it first becomes "inactive" and the script then starts the 7.18 +# script again to make it "started") then you can state this below. 7.19 +# In other words, unless you understand service dependencies and are a 7.20 +# competent shell scripter, don't set this. 7.21 +RE_ENTER="no"