Différences

Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.

init_nosfvpn [2010/08/06 12:57] (Version actuelle)
Ligne 1: Ligne 1:
 +<code>
 +#!/sbin/runscript
 +# Copyright 1999-2007 Gentoo Foundation
 +# Distributed under the terms of the GNU General Public License v2
  
 +# Variables globales
 +
 +VPNDIR="/etc/openvpn"
 +VPNPID2="/var/run/openvpn.nosferatu.pid"
 +VPNCONF2="${VPNDIR}/nosferatu.conf"
 +
 +depend() {
 +        need localmount net
 +        before netmount
 +        after bootmisc
 +}
 +
 +checktundevice() {
 +        if [ ! -e /dev/net/tun ]; then
 +                if ! modprobe tun ; then
 +                        eerror "TUN/TAP support is not available in this kernel"
 +                        return 1
 +                fi
 +        fi
 +        if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
 +                ebegin "Detected broken /dev/net/tun symlink, fixing..."
 +                rm -f /dev/net/tun
 +                ln -s /dev/misc/net/tun /dev/net/tun
 +                eend $?
 +        fi
 +}
 +
 +start() {
 +         ebegin "Starting nosferatu"
 +         if [ ! -e "${VPNCONF2}" ]; then
 +                eend 1 "${VPNCONF2} does not exist"
 +                return 1
 +        fi
 +        if ! grep -q "^[ \t]*cd[ \t].*" "${VPNCONF2}" ; then
 +                args="${args} --cd ${VPNDIR}"
 +        fi
 +
 +        start-stop-daemon --start --exec /usr/sbin/openvpn --pidfile "${VPNPID2}" \
 +                -- --config "${VPNCONF2}" --writepid "${VPNPID2}" --daemon ${args}
 + eend $?
 +}
 +
 +stop() {
 +        ebegin "stop nosferatu"
 +        start-stop-daemon --stop --exec /usr/sbin/openvpn --pidfile "${VPNPID2}"
 +        eend $?
 +}
 +
 +</code>
 
init_nosfvpn.txt · Dernière modification: 2010/08/06 12:57 (modification externe)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki