# HG changeset patch # User Alexander Medvedev # Date 1397728872 -14400 # Node ID cc6e05d2cb9a009a46cf24c15aacac81eb07f575 # Parent ad47999f35d7216ed516e9c7ce7e0da4b742b152 Up: openvpn (2.3.3), added openvpn-doc, added initscript (TEST AND FIX, PLEASE) diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn-doc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openvpn-doc/receipt Thu Apr 17 14:01:12 2014 +0400 @@ -0,0 +1,25 @@ +# SliTaz package receipt. + +PACKAGE="openvpn-doc" +VERSION="2.3.3" +CATEGORY="network" +SHORT_DESC="Documentation for OpenVPN." +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="GPL2" +WEB_SITE="http://openvpn.net/" +TAGS="vpn tunnel" +HOST_ARCH="i486 arm" + +WANTED="openvpn" +DEPENDS="openvpn" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share/openvpn + cp -a $install/usr/share/ $fs/usr/ + cp -a $src/sample/sample-config-files $fs/usr/share/openvpn + cp -a $src/sample/sample-plugins $fs/usr/share/openvpn + cp -a $src/sample/sample-keys $fs/usr/share/openvpn + cp -a $src/sample/sample-scripts $fs/usr/share/openvpn +} diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn-down-root/receipt --- a/openvpn-down-root/receipt Thu Apr 17 11:15:22 2014 +0400 +++ b/openvpn-down-root/receipt Thu Apr 17 14:01:12 2014 +0400 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="openvpn-down-root" -VERSION="2.3.2" +VERSION="2.3.3" CATEGORY="network" SHORT_DESC="The down-root plugin for OpenVPN." MAINTAINER="pascal.bellard@slitaz.org" diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn-pam/receipt --- a/openvpn-pam/receipt Thu Apr 17 11:15:22 2014 +0400 +++ b/openvpn-pam/receipt Thu Apr 17 14:01:12 2014 +0400 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="openvpn-pam" -VERSION="2.3.2" +VERSION="2.3.3" CATEGORY="network" SHORT_DESC="PAM plugin for OpenVPN." MAINTAINER="pascal.bellard@slitaz.org" diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn/receipt --- a/openvpn/receipt Thu Apr 17 11:15:22 2014 +0400 +++ b/openvpn/receipt Thu Apr 17 14:01:12 2014 +0400 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="openvpn" -VERSION="2.3.2" +VERSION="2.3.3" CATEGORY="network" SHORT_DESC="Full-featured open source SSL VPN solution." MAINTAINER="pascal.bellard@slitaz.org" @@ -34,12 +34,15 @@ { mkdir -p $fs/usr/sbin cp -a $install/usr/sbin/openvpn $fs/usr/sbin + cp -a $stuff/etc $fs + chown root.root $fs/etc/init.d/* + chmod 0644 $fs/etc/openvpn/openvpn.conf } # Post install/remove commands for Tazpkg. post_install() { - mkdir -p ${root}/etc/openvpn ${root}/var/run/openvpn + mkdir -p ${root}/var/run/openvpn } post_remove() diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn/stuff/etc/init.d/openvpn-client --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openvpn/stuff/etc/init.d/openvpn-client Thu Apr 17 14:01:12 2014 +0400 @@ -0,0 +1,77 @@ +#!/bin/sh +# /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=OpenVPN +DESC="VPN daemon" +DAEMON=/usr/sbin/openvpn +OPTIONS=$OPENVPN_OPTIONS +PIDFILE=/var/run/rsyncd.pid + +checktundevice() { + if [ ! -e /dev/net/tun ]; then + if ! modprobe tun ; then + echo -n "TUN/TAP support is not available in this kernel" + return 1 + fi + fi + if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then + echo -n "Detected broken /dev/net/tun symlink, fixing..." + rm -f /dev/net/tun + ln -s /dev/misc/net/tun /dev/net/tun + fi +} + +case "$1" in + start) + checktundevice + + if [ ! -e /etc/openvpn/client.conf ]; then + echo "Missing OpenVPN client config." + exit 1 + fi + if active_pidfile $PIDFILE openvpn ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON --client $OPTIONS + status + ;; + stop) + if ! active_pidfile $PIDFILE openvpn ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if ! active_pidfile $PIDFILE openvpn ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + $DAEMON --client $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn/stuff/etc/init.d/openvpn-server --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openvpn/stuff/etc/init.d/openvpn-server Thu Apr 17 14:01:12 2014 +0400 @@ -0,0 +1,77 @@ +#!/bin/sh +# /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=OpenVPN +DESC="VPN daemon" +DAEMON=/usr/sbin/openvpn +OPTIONS=$OPENVPN_OPTIONS +PIDFILE=/var/run/rsyncd.pid + +checktundevice() { + if [ ! -e /dev/net/tun ]; then + if ! modprobe tun ; then + echo -n "TUN/TAP support is not available in this kernel" + return 1 + fi + fi + if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then + echo -n "Detected broken /dev/net/tun symlink, fixing..." + rm -f /dev/net/tun + ln -s /dev/misc/net/tun /dev/net/tun + fi +} + +case "$1" in + start) + checktundevice + + if [ ! -e /etc/openvpn/server.conf ]; then + echo "Missing OpenVPN server config." + exit 1 + fi + if active_pidfile $PIDFILE openvpn ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS + status + ;; + stop) + if ! active_pidfile $PIDFILE openvpn ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if ! active_pidfile $PIDFILE openvpn ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r ad47999f35d7 -r cc6e05d2cb9a openvpn/stuff/etc/openvpn/openvpn.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openvpn/stuff/etc/openvpn/openvpn.conf Thu Apr 17 14:01:12 2014 +0400 @@ -0,0 +1,18 @@ +# OpenVPN automatically creates an /etc/resolv.conf (or sends it to +# resolvconf) if given DNS information by the OpenVPN server. +# Set PEER_DNS="no" to stop this. +PEER_DNS="yes" + +# OpenVPN can run in many modes. Most people will want the init script +# to automatically detect the mode and try and apply a good default +# configuration and setup scripts. However, there are cases where the +# OpenVPN configuration looks like a client, but it's really a peer or +# something else. DETECT_CLIENT controls this behaviour. +DETECT_CLIENT="yes" + +# If DETECT_CLIENT is no and you have your own scripts to re-enter the openvpn +# init script (ie, it first becomes "inactive" and the script then starts the +# script again to make it "started") then you can state this below. +# In other words, unless you understand service dependencies and are a +# competent shell scripter, don't set this. +RE_ENTER="no"