#! /bin/bash # # wicd Bring up/down networking # # chkconfig: - 10 90 # description: Wicd is a wireless and wired network manager for Linux. # start at boot time. # probe: false # ### BEGIN INIT INFO # Provides: wicd # Should-Start: harddrake irda resolvconf slmodemd # Should-Stop: irda resolvconf slmodemd # Default-Start: 2 3 4 5 # Short-Description: Bring up/down networking # Description: Activates/Deactivates all network interfaces configured to # start at boot time. # Should-Start: iptables ip6tables ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions set +x WICD_BIN=/usr/sbin/wicd IFCONFIG_BIN=/sbin/ifconfig case "$1" in start) gprintf "Starting wicd services: " $IFCONFIG_BIN lo up daemon $WICD_BIN RETVAL=$? echo if [ $RETVAL -eq 0 ]; then touch /var/lock/subsys/wicd else gprintf "Wicd already running" echo exit 1 fi ;; stop) if [ -f /var/lock/subsys/wicd ]; then gprintf "Shutting down wicd services: " killproc -p /var/run/wicd/wicd.pid wicd -15 #killall wicd RETVAL=$? echo if [ $RETVAL -eq 0 ]; then rm -f /var/lock/subsys/wicd rm -f /var/run/wicd/wicd.pid else gprintf "Wicd not running" echo exit 7 fi fi ;; status) if pidofproc wicd ; then gprintf "wicd is running.\n" else status wicd fi ;; restart | reload) $0 stop $0 start ;; *) gprintf "Usage: wicd {start|stop|status|reload|restart}\n" exit 1 ;; esac