mirror of
https://github.com/gryf/wicd.git
synced 2025-12-28 17:32:36 +01:00
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).
45 lines
883 B
Plaintext
45 lines
883 B
Plaintext
#!/sbin/runscript
|
|
#
|
|
# wicd: wicd daemon
|
|
#
|
|
# chkconfig: 345 98 02
|
|
# description: This is a daemon for managing network connections.
|
|
#
|
|
# processname: wicd
|
|
# pidfile: /var/run/wicd.pid
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: $network
|
|
### END INIT INFO
|
|
WICD_BIN=/opt/wicd/daemon.py
|
|
NAME=wicd-daemon
|
|
|
|
# Sanity checks.
|
|
[ -x $WICD_BIN ] || exit 0
|
|
|
|
# so we can rearrange this easily
|
|
processname=$WICD_BIN
|
|
pidfile=/var/run/wicd.pid
|
|
processargs="-P ${pidfile}"
|
|
|
|
start()
|
|
{
|
|
if [ -e ${pidfile} ]; then
|
|
rm -f ${pidfile}
|
|
fi
|
|
ebegin "Starting wicd"
|
|
start-stop-daemon --start --quiet --exec ${processname} -- ${processargs}
|
|
eend $?
|
|
}
|
|
|
|
stop()
|
|
{
|
|
ebegin "Stopping wicd"
|
|
start-stop-daemon --stop --quiet --name ${NAME} --pidfile ${pidfile}
|
|
eend $?
|
|
if [ -e ${pidfile} ]; then
|
|
rm -f $pidfile
|
|
fi
|
|
}
|
|
|