summaryrefslogtreecommitdiff
path: root/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-wifi-ap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-wifi-ap.sh')
-rw-r--r--multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-wifi-ap.sh58
1 files changed, 0 insertions, 58 deletions
diff --git a/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-wifi-ap.sh b/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-wifi-ap.sh
deleted file mode 100644
index 5c684cb..0000000
--- a/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-wifi-ap.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-
-do_start() {
- echo "starting hostap daemon"
- /etc/init.d/hostapd start
- echo "setting IP address of access point"
- ifconfig wlan0 $1
- ocg-wifi-dhcpd.sh start
-}
-
-do_stop() {
- echo "stopping hostap daemon"
- /etc/init.d/hostapd stop
- ocg-wifi-dhcpd.sh stop
-}
-
-# main
-if [[ $# -lt 1 ]]
-then
- echo "usage: $0 start|stop|restart [access point IP address]"
- exit 1
-elif [[ $# -eq 2 ]]
-then
- ret=1
- if [[ $2 =~ ^([0-9]{1,3}\.){3,3}[0-9]{1,3}$ ]]
- then
- OIFS=$IFS
- IFS='.'
- ip=($2)
- IFS=$OFIS
- [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
- ret=$?
- fi
- if [[ ret -ne 0 ]]
- then
- echo "invalid IP address"
- exit 1
- fi
- ip=$2
-else
- ip="192.168.2.1"
-fi
-
-case $1 in
- start)
- do_start $ip
- ;;
- stop)
- do_stop
- ;;
- restart)
- do_stop
- sleep 1
- do_start $ip
- ;;
-esac
-
-exit 0