new initscripts for Gentoo

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3346 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Saleem Abdulrasool 2008-02-28 06:07:50 +00:00
parent 8ffe21b65f
commit 616663c69d
3 changed files with 47 additions and 91 deletions

View file

@ -1,3 +1,11 @@
2008-02-27 Saleem Abdulrasool <compnerd@compnerd.org>
reviewed by: steev@steev.net
* initscript/Gentoo/NetworkManager.in:
* initscript/Gentoo/NetworkManagerDispatcher.in:
Update the scripts and move them to Gentoo style.
2008-02-27 Dan Williams <dcbw@redhat.com>
Patch from Will Stephenson <wstephenson@kde.org>

View file

@ -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:

View file

@ -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: