summaryrefslogtreecommitdiff
path: root/initscript
diff options
context:
space:
mode:
Diffstat (limited to 'initscript')
-rwxr-xr-xinitscript/Gentoo/NetworkManager.in67
-rwxr-xr-xinitscript/Gentoo/NetworkManagerDispatcher.in63
2 files changed, 39 insertions, 91 deletions
diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in
index 10988cc06c..9b23185b31 100755
--- a/initscript/Gentoo/NetworkManager.in
+++ b/initscript/Gentoo/NetworkManager.in
@@ -1,55 +1,28 @@
#!/sbin/runscript
-#
-# NetworkManager: NetworkManager daemon
-#
-# chkconfig: 345 98 02
-# description: This is a daemon for automatically switching network \
-# connections to the best available connection. \
-#
-# processname: NetworkManager
-# pidfile: /var/run/NetworkManager.pid
-#
-### BEGIN INIT INFO
-# Provides: $network
-### END INIT INFO
-
-prefix=@prefix@
-exec_prefix=@prefix@
-sbindir=@sbindir@
-
-NETWORKMANAGER_BIN=${sbindir}/NetworkManager
-
-# Sanity checks.
-[ -x $NETWORKMANAGER_BIN ] || exit 0
-
-# We need /sbin/ip
-[ -x /sbin/ip ] || exit 0
-
-# so we can rearrange this easily
-processname=$NETWORKMANAGER_BIN
-pidfile=/var/run/NetworkManager.pid
+# Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org>
+# Distributed under the terms of the GNU General Purpose License v2
+# $Header: $
depend() {
- need hald dhcdbd
+ need hald
}
-start()
-{
- if [ -e ${pidfile} ]; then
- rm -f ${pidfile}
- fi
- ebegin "Starting NetworkManager"
- start-stop-daemon --start --quiet --exec ${processname}
- eend $?
- echo $(/bin/pidof NetworkManager) > ${pidfile}
+start() {
+ ebegin "Starting NetworkManager"
+ start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid --exec /usr/sbin/NetworkManager
+ eend $?
}
-stop()
-{
- ebegin "Stopping NetworkManager"
- start-stop-daemon --stop --quiet --exec ${processname} --pidfile ${pidfile}
- eend $?
- if [ -e ${pidfile} ]; then
- rm -f $pidfile
- fi
+stop() {
+ local retval
+
+ ebegin "Stopping NetworkManager"
+ start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManager.pid
+ retval=$?
+ eend ${retval}
+
+ [ -e /var/run/NetworkManager.pid ] && rm -f /var/run/NetworkManager.pid
+ return ${retval}
}
+
+# vim: set ft=gentoo-init-d ts=3 sw=3 et:
diff --git a/initscript/Gentoo/NetworkManagerDispatcher.in b/initscript/Gentoo/NetworkManagerDispatcher.in
index dcfe4534bb..8165275d38 100755
--- a/initscript/Gentoo/NetworkManagerDispatcher.in
+++ b/initscript/Gentoo/NetworkManagerDispatcher.in
@@ -1,52 +1,27 @@
#!/sbin/runscript
-#
-# NetworkManagerDispatcher: NetworkManagerDispatcher daemon
-#
-# chkconfig: 345 98 02
-# description: This is a daemon for automatically executing scripts \
-# when network connections change. \
-#
-# processname: NetworkManagerDispatcher
-# pidfile: /var/run/NetworkManagerDispatcher.pid
-#
-### BEGIN INIT INFO
-# Provides: networkmanager-dispatcher
-### END INIT INFO
-
-prefix=@prefix@
-exec_prefix=@prefix@
-sbindir=@sbindir@
-
-NETWORKMANAGERDISPATCHER_BIN=${sbindir}/NetworkManagerDispatcher
-
-# Sanity checks.
-[ -x $NETWORKMANAGERDISPATCHER_BIN ] || exit 0
-
-# so we can rearrange this easily
-processname=$NETWORKMANAGERDISPATCHER_BIN
-pidfile=/var/run/NetworkManagerDispatcher.pid
+# Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org>
+# Distributed under the terms of the GNU General Purpose License v2
+# $Header: $
depend() {
- need NetworkManager
+ need NetworkManager
}
-start()
-{
- if [ -e ${pidfile} ]; then
- rm -f ${pidfile}
- fi
- ebegin "Starting NetworkManagerDispatcher"
- start-stop-daemon --start --quiet --exec ${processname}
- eend $?
- echo $(/bin/pidof NetworkManagerDispatcher) > ${pidfile}
+start() {
+ ebegin "Starting NetworkManagerDispatcher"
+ start-stop-daemon --start --quiet --pidfile /var/run/NetworkManagerDispatcher.pid --exec /usr/sbin/NetworkManagerDispatcher
+ eend $?
}
-stop()
-{
- ebegin "Stopping NetworkManagerDispatcher"
- start-stop-daemon --stop --quiet --exec ${processname} --pidfile ${pidfile}
- eend $?
- if [ -e ${pidfile} ]; then
- rm -f $pidfile
- fi
+stop() {
+ local retval
+
+ ebegin "Stopping NetworkManagerDispatcher"
+ start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManagerDispatcher.pid
+ retval=$?
+ eend ${retval}
+
+ [ -e /var/run/NetworkManagerDispatcher.pid ] && rm -f /var/run/NetworkManagerDispatcher.pid
}
+
+# vim: set ft=gentoo-init-d ts=3 sw=3 et: