aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/vpnc/vpnc.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2016-08-25 15:26:24 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-25 15:26:24 +0200
commitb6af1e02efe594039707cd882517663d5370f375 (patch)
treeff9c2d55873e051e82972ba64c017352d3a75d34 /unmaintained/vpnc/vpnc.initd
parenta71346b7acebc600960a98c84fb32cfd72fe864b (diff)
downloadaports-b6af1e02efe594039707cd882517663d5370f375.tar.bz2
aports-b6af1e02efe594039707cd882517663d5370f375.tar.xz
testing/[multiple]: move unmaintained packages
This moves all packages from testing to unmaintained which have not been updated for atleast 6 months. If you are affected by this commit please follow this proceddure: * make sure your packages build on all architectures * move your pacakge(s) back to testing * if you want to keep this package and can maintain it (or find somebody to maintain it for you) for a minimum of 6 months ask it to be moved to community
Diffstat (limited to 'unmaintained/vpnc/vpnc.initd')
-rw-r--r--unmaintained/vpnc/vpnc.initd103
1 files changed, 103 insertions, 0 deletions
diff --git a/unmaintained/vpnc/vpnc.initd b/unmaintained/vpnc/vpnc.initd
new file mode 100644
index 0000000000..f5c5dc6e63
--- /dev/null
+++ b/unmaintained/vpnc/vpnc.initd
@@ -0,0 +1,103 @@
+#!/sbin/runscript
+
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/vpnc/files/vpnc-3.init,v 1.2 2010/08/13 08:39:48 fauli Exp $
+
+VPNDIR="/etc/vpnc"
+VPN="${SVCNAME#*.}"
+if [ -n ${VPN} ] && [ ${SVCNAME} != "vpnc" ]; then
+ mkdir -p /var/run/vpnc
+ VPNPID="/var/run/vpnc/${VPN}.pid"
+else
+ VPNPID="/var/run/vpnc.pid"
+fi
+VPNCONF="${VPNDIR}/${VPN}.conf"
+VPNSCRIPTDIR="${VPNDIR}/scripts.d"
+PREUPSCRIPT="${VPNSCRIPTDIR}/${VPN}-preup.sh"
+PREDOWNSCRIPT="${VPNSCRIPTDIR}/${VPN}-predown.sh"
+POSTUPSCRIPT="${VPNSCRIPTDIR}/${VPN}-postup.sh"
+POSTDOWNSCRIPT="${VPNSCRIPTDIR}/${VPN}-postdown.sh"
+# We should source this file to avoid problems when init script
+# name differs from the default name
+. /etc/conf.d/vpnc
+
+depend() {
+ need net
+ before netmount
+}
+
+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
+}
+
+screenoutput() {
+ if [ "${VPNCOUTPUT}" = "yes" ]; then
+ export SCREEN_OUTPUT="/dev/stdout"
+ else
+ export SCREEN_OUTPUT="/dev/null"
+ fi
+}
+
+start() {
+ ebegin "Starting VPNC: ${VPN}"
+
+ checktundevice || return 1
+ screenoutput
+
+ if [ ! -e "${VPNCONF}" ]; then
+ eend 1 "${VPNCONF} does not exist"
+ return 1
+ fi
+
+ local args=""
+
+ if [ -x "${PREUPSCRIPT}" ] ; then
+ "${PREUPSCRIPT}" > ${SCREEN_OUTPUT}
+ fi
+
+ start-stop-daemon --start --pidfile "${VPNPID}" --exec /usr/sbin/vpnc \
+ -- --pid-file "${VPNPID}" "${VPNCONF}" > ${SCREEN_OUTPUT}
+ local retval=$?
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+ if [ -x "${POSTUPSCRIPT}" ] ; then
+ "${POSTUPSCRIPT}" > ${SCREEN_OUTPUT}
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping VPNC: ${VPN}"
+ screenoutput
+ if [ -x "${PREDOWNSCRIPT}" ] ; then
+ "${PREDOWNSCRIPT}" > ${SCREEN_OUTPUT}
+ fi
+
+ start-stop-daemon --stop --pidfile "${VPNPID}"
+ local retval=$?
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+
+ if [ -x "${POSTDOWNSCRIPT}" ] ; then
+ "${POSTDOWNSCRIPT}" > ${SCREEN_OUTPUT}
+ fi
+ eend $?
+}