summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/gogoc/files/gogoc.rc')
-rw-r--r--net-misc/gogoc/files/gogoc.rc42
1 files changed, 42 insertions, 0 deletions
diff --git a/net-misc/gogoc/files/gogoc.rc b/net-misc/gogoc/files/gogoc.rc
new file mode 100644
index 000000000000..f7c723d9b33e
--- /dev/null
+++ b/net-misc/gogoc/files/gogoc.rc
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# 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 $?
+}