#!/sbin/openrc-run # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ 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 $? }