mirror of
https://github.com/gryf/wicd.git
synced 2025-12-22 05:48:03 +01:00
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).
This commit is contained in:
63
other/initscripts/arch/wicd
Normal file
63
other/initscripts/arch/wicd
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Copyright (C) 2007 Dan O'Reilly
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License Version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
WICD_BIN=$/opt/wicd/daemon.py
|
||||
CMD=$0
|
||||
ARG=$1
|
||||
|
||||
# general config
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
# Sanity checks.
|
||||
[ -x $WICD_BIN ] || exit 0
|
||||
set -- $(ps ax | grep 'python.*$WICD_BIN')
|
||||
PID=$1
|
||||
case "$ARG" in
|
||||
start)
|
||||
stat_busy "Starting wicd"
|
||||
if [ -z "$PID" ]; then
|
||||
$WICD_BIN
|
||||
fi
|
||||
if [ ! -z "$PID" -o $? -gt 0 ]; then
|
||||
stat_fail
|
||||
else
|
||||
add_daemon wicd
|
||||
stat_done
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping wicd"
|
||||
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
stat_fail
|
||||
else
|
||||
rm_daemon wicd
|
||||
stat_done
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$CMD stop
|
||||
sleep 1
|
||||
$CMD start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $CMD {start|stop|restart}"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user