--- ./etc/init.d/wicd.sdg	2007-03-30 09:14:30.000000000 -0400
+++ ./etc/init.d/wicd	2007-09-16 18:30:53.000000000 -0400
@@ -1,15 +1,58 @@
-#!/bin/bash
+#!/bin/sh
+#
+# wicd:		Wireless Internet Connection Daemon
+#
+# chkconfig:	345 26 89
+# description:	Manage wireless connections, and wired connections as a bonus.
+#
 
-if [[ $1 = "start" ]]
-then
-	echo "Stopping any running daemons..."
-	killall daemon.py 2> /dev/null
-	echo "Starting wicd daemon..."
-	/opt/wicd/daemon.py 2> /dev/null
-fi
-
-if [[ $1 = "stop" ]]
-then
-	echo "Stopping wicd daemon..."
-	killall daemon.py 2> /dev/null
-fi
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+#[ -r /etc/sysconfig/wicd ] && . /etc/sysconfig/wicd
+
+start() 
+{
+
+        echo -n $"Starting wicd: "
+        daemon /sbin/daemon.py -P/var/run/wicd.pid 2>/dev/null
+
+	touch /var/lock/subsys/wicd
+        echo
+}
+
+stop() 
+{
+        echo -n $"Shutting down wicd: "
+	killproc daemon.py
+
+	rm -f  /var/lock/subsys/wicd
+        echo
+}
+
+[ -x /sbin/daemon.py ] || exit 0
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  stop)
+	stop
+        ;;
+  restart|reload)
+	stop
+	start
+	;;
+  condrestart)
+	[ -e /var/lock/subsys/wicd ] && (stop; start)
+	;;
+  status)
+  	status daemon.py
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|restart|reload|condrestart}"
+        exit 1
+esac
+
+exit 0
