File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / uboot / rc.d / 011.sta.stop
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Mon Feb 13 16:52:47 2017 UTC (7 years, 10 months ago) by misho
Branches: MAIN
CVS tags: elwix2_8, elwix2_7, elwix2_6, HEAD, ELWIX2_7, ELWIX2_6, ELWIX2_5
ELWIX 2.5

#!/bin/sh

IFACE="wlan0"
WIFIDEV="ath0"
CLONEOPTS=""

REGDOMAIN=""
COUNTRY=""

SSID="ap"
BINT="100"
WIFIOPTS=""

OPTS=""
#IP="auto"
IP="172.31.1.2/30"
#IP6="auto"
IP6=""

[ -z "$IFACE" -o -z "$WIFIDEV" ] && exit

echo "Config wireless Station interface $IFACE ..."

ifconfig $IFACE create wlandev $WIFIDEV $CLONEOPTS wlanmode sta || exit
if [ -n "$REGDOMAIN" ]; then
	ifconfig $IFACE regdomain $REGDOMAIN
fi
if [ -n "$COUNTRY" ]; then
	ifconfig $IFACE country $COUNTRY
fi
if [ -n "$WIFIOPTS" ]; then
	ifconfig $IFACE $WIFIOPTS
fi
if [ -n "$BINT" ]; then
	ifconfig $IFACE bintval $BINT
fi
if [ -n "$CHAN" ]; then
	ifconfig $IFACE channel $CHAN
fi
if [ -n "$SSID" ]; then
	ifconfig $IFACE ssid $SSID
fi
if [ -n "$IP" ]; then
	if [ "$IP" = "auto" ]; then
		dhclient $IFACE
	else
		ifconfig $IFACE inet $IP
	fi
fi
if [ -n "$IP6" ]; then
	if [ "$IP" = "auto" ]; then
		ifconfig $IFACE accept_rtadv
	else
		ifconfig $IFACE inet6 $IP6
	fi
fi
ifconfig $IFACE $OPTS up

[ -x /etc/sysctl.$IFACE ] && /etc/sysctl.$IFACE

[ -x /etc/wifi_up.sh ] && /etc/wifi_up.sh $IFACE >/dev/null 2>&1 &

#wlandebug -i $IFACE state+scan+assoc+auth+11n

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>