1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-21 13:28:08 +01:00
Files
wicd/other/initscripts/redhat/wicd
imdano ef9b5cc7f3 Added distro-specific init scripts based on those used by NM (these are very experimental and likely broken in many cases).
Updated setup.py to pick which initscript to install based on the distro detected.
Updated MANIFEST.in to make sure launchdaemon.sh is included in the sdist build.
Fixed a bunch of crash bugs in tool detection system when tools are detected.
Made tool detection work correctly when "which" returns output if no match is found (as opposed to no output).  Eventually we might want to hardcode possible paths instead of using which at all...
Fixed some message formatting in the daemon.
Added some docstrings.
Added a pidfile system for increased initscript compatibility (sort of, it's somewhat incomplete).
2008-03-24 00:03:35 +00:00

76 lines
1.5 KiB
Bash

#!/bin/sh
#
# wicd: wicd daemon
#
# chkconfig: 345 20 89
# description: This is a daemon for managing network connections.
#
# processname: wicd
# pidfile: /var/run/wicd/wicd.pid
#
WICD_BIN=/opt/wicd/daemon.py
# Sanity checks.
[ -x $WICD_BIN ] || exit 11
# Source function library.
. /etc/rc.d/init.d/functions
# so we can rearrange this easily
processname=$WICD_BIN
servicename=wicd
pidfile=/var/run/wicd/wicd.pid
RETVAL=0
start()
{
echo -n $"Starting wicd daemon: "
daemon --check $servicename $processname --pid-file=$pidfile
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
}
stop()
{
echo -n $"Stopping wicd daemon: "
killproc -p $pidfile $servicename
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/$servicename
rm -f $pidfile
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p $pidfile $processname
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$servicename ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
;;
esac
exit $RETVAL