]> git.pld-linux.org Git - packages/hostapd.git/commitdiff
- hostapd init
authorpbern <pbern@pld-linux.org>
Sun, 28 Sep 2003 18:05:15 +0000 (18:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    hostapd.init -> 1.1

hostapd.init [new file with mode: 0644]

diff --git a/hostapd.init b/hostapd.init
new file mode 100644 (file)
index 0000000..f15ecee
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# hostapd      This script is used to start and stop hostapd service
+#
+# chkconfig:   345 83 17
+#
+# description: hostapd is a deamon to run wlan card based on prism2
+#              chip as Access Point.
+#
+# Author:      Pawel Bernadowski "pbern" <kontakt@pbern.biz>
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networkin is up
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down hostapd
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start) 
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/hostapd ]; then
+               msg_starting hostapd 
+               daemon /sbin/hostapd /etc/hostap/hostapd.conf -B
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hostapd
+       else
+               msg_already_running hostapd
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/hostapd ]; then
+               # Stop daemon
+               msg_stopping hostapd
+               killproc hostapd
+               rm -f /var/lock/subsys/hostapd >/dev/null 2>&1
+       else
+               msg_not_running hostapd
+       fi
+       ;;
+  restart|force-reload)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  status)
+       status hostapd
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
This page took 0.133121 seconds and 4 git commands to generate.