summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/ipcad/files/ipcad.init')
-rw-r--r--net-analyzer/ipcad/files/ipcad.init37
1 files changed, 37 insertions, 0 deletions
diff --git a/net-analyzer/ipcad/files/ipcad.init b/net-analyzer/ipcad/files/ipcad.init
new file mode 100644
index 000000000000..ba3a88e712e7
--- /dev/null
+++ b/net-analyzer/ipcad/files/ipcad.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f /etc/ipcad.conf ] ; then
+ eerror "No /etc/ipcad.conf file exists!"
+ return 1
+ fi
+
+ `egrep -v "(^#|^$)" /etc/ipcad.conf | grep interface > /dev/null 2>&1` || {
+ eerror "Please, configure at least one interface in /etc/ipcad.conf." ;
+ return 1 ;
+ }
+
+ return 0
+}
+
+start() {
+ # Comment out the following line to get faster startups
+ checkconfig || return 1
+
+ ebegin "Starting ipcad"
+ start-stop-daemon --start --pidfile=/var/ipcad/run/ipcad.pid --exec /usr/sbin/ipcad -- ${IPCAD_OPTS}
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping ipcad"
+ start-stop-daemon --stop --pidfile=/var/ipcad/run/ipcad.pid --exec /usr/sbin/ipcad --retry 20
+ eend $?
+}