summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Schlich <wschlich@gentoo.org>2003-10-23 10:03:25 +0000
committerWolfram Schlich <wschlich@gentoo.org>2003-10-23 10:03:25 +0000
commitbe08540095bf3f664298233f22f64fd2175f4b93 (patch)
tree7f1a263b4daab0e82191f694c8772efff2534fdf /net-wireless/hostapd/files
parentMakefile fix (#31801) (diff)
downloadgentoo-2-be08540095bf3f664298233f22f64fd2175f4b93.tar.gz
gentoo-2-be08540095bf3f664298233f22f64fd2175f4b93.tar.bz2
gentoo-2-be08540095bf3f664298233f22f64fd2175f4b93.zip
HostAPD init script was missing - added
Diffstat (limited to 'net-wireless/hostapd/files')
-rw-r--r--net-wireless/hostapd/files/hostapd.init.d44
1 files changed, 44 insertions, 0 deletions
diff --git a/net-wireless/hostapd/files/hostapd.init.d b/net-wireless/hostapd/files/hostapd.init.d
new file mode 100644
index 000000000000..994942ee3e8a
--- /dev/null
+++ b/net-wireless/hostapd/files/hostapd.init.d
@@ -0,0 +1,44 @@
+#!/sbin/runscript
+
+svc_name="HostAPD"
+
+hostapd="/usr/sbin/hostapd"
+hostapd_cfg="/etc/hostapd/hostapd.conf"
+
+opts="${opts} reload"
+
+depend() {
+ ## if necessary change net.wlan0 to your wlan device
+ need net.wlan0 logger
+}
+
+checkconfig() {
+ if [ ! -x "${hostapd}" ]; then
+ eerror "HostAPD binary [${hostapd}] missing"
+ fi
+ if [ ! -r "${hostapd_cfg}" ] ; then
+ eerror "HostAPD config [${hostapd_cfg}] missing"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting ${svc_name}"
+ start-stop-daemon --start --quiet --exec "${hostapd}" -- -B "${hostapd_cfg}"
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+ ebegin "Stopping ${svc_name}"
+ start-stop-daemon --stop --quiet --exec "${hostapd}"
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading ${svc_name}"
+ start-stop-daemon --stop --signal 1 --quiet --exec "${hostapd}"
+ eend $?
+}