You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-misc/gogoc/files/gogoc.rc

43 lines
959 B

#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/gogoc/files/gogoc.rc,v 1.5 2012/02/03 09:22:02 voyageur Exp $
depend() {
need net localmount
after bootmisc
use dns logger
}
checktun() {
[ $(uname -s) = "Linux" ] || return 0
[ -e /dev/net/tun ] && return 0
modprobe tun && return 0
eerror "TUN/TAP support is not available in the running kernel"
return 1
}
checkconfig() {
if ! [ -f /etc/gogoc/gogoc.conf ]; then
eerror "Unable to find configuration file /etc/gogoc/gogoc.conf"
return 1
fi
}
start() {
checktun || return 1
checkconfig || return 1
ebegin "Starting gogoCLIENT"
start-stop-daemon --start --exec /usr/sbin/gogoc \
--chdir /var/lib/gogoc -- -f /etc/gogoc/gogoc.conf -y
eend $?
}
stop() {
ebegin "Stopping gogoCLIENT"
start-stop-daemon --stop --exec /usr/sbin/gogoc
eend $?
}