Merge branch 'WebReflection-patch-1'

Fixes #8
This commit is contained in:
oblique 2013-12-15 12:38:48 +02:00
commit 452689bdbb
2 changed files with 13 additions and 2 deletions

View File

@ -49,6 +49,9 @@
### Internet sharing from the same WiFi interface: ### Internet sharing from the same WiFi interface:
create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase
### Choose a different WiFi adapter driver
create_ap --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase
### No passphrase (open network) using pipe: ### No passphrase (open network) using pipe:
echo -e "MyAccessPoint" | create_ap wlan0 eth0 echo -e "MyAccessPoint" | create_ap wlan0 eth0

View File

@ -30,6 +30,7 @@ usage() {
echo " 'bridge' for bridging" echo " 'bridge' for bridging"
echo " 'none' for no Internet sharing (equivalent to -n)" echo " 'none' for no Internet sharing (equivalent to -n)"
echo " --hidden Make the Access Point hidden (do not broadcast the SSID)" echo " --hidden Make the Access Point hidden (do not broadcast the SSID)"
echo " --driver Choose your WiFi adapter driver (default: nl80211)"
echo echo
echo "Non-Bridging Options:" echo "Non-Bridging Options:"
echo " -g <gateway> IPv4 Gateway for the Access Point (default: 192.168.12.1)" echo " -g <gateway> IPv4 Gateway for the Access Point (default: 192.168.12.1)"
@ -47,6 +48,7 @@ usage() {
echo " $(basename $0) wlan0 wlan0 MyAccessPoint MyPassPhrase" echo " $(basename $0) wlan0 wlan0 MyAccessPoint MyPassPhrase"
echo " $(basename $0) -n wlan0 MyAccessPoint MyPassPhrase" echo " $(basename $0) -n wlan0 MyAccessPoint MyPassPhrase"
echo " $(basename $0) -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase" echo " $(basename $0) -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase"
echo " $(basename $0) --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase"
} }
get_macaddr() { get_macaddr() {
@ -121,6 +123,7 @@ WPA_VERSION=1+2
ETC_HOSTS=0 ETC_HOSTS=0
HIDDEN=0 HIDDEN=0
SHARE_METHOD=nat SHARE_METHOD=nat
DRIVER=nl80211
CONFDIR= CONFDIR=
VWIFI_IFACE= VWIFI_IFACE=
@ -176,7 +179,7 @@ die() {
# if the user press ctrl+c then execute die() # if the user press ctrl+c then execute die()
trap "die" SIGINT trap "die" SIGINT
ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden" -n $(basename $0) -- "$@") ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden","driver:" -n $(basename $0) -- "$@")
[[ $? -ne 0 ]] && exit 1 [[ $? -ne 0 ]] && exit 1
eval set -- "$ARGS" eval set -- "$ARGS"
@ -218,6 +221,11 @@ while :; do
SHARE_METHOD="$1" SHARE_METHOD="$1"
shift shift
;; ;;
--driver)
shift
DRIVER="$1"
shift
;;
--) --)
shift shift
break break
@ -333,7 +341,7 @@ networkmanager_add_unmanaged ${VWIFI_IFACE}
cat << EOF > $CONFDIR/hostapd.conf cat << EOF > $CONFDIR/hostapd.conf
ssid=${SSID} ssid=${SSID}
interface=${VWIFI_IFACE} interface=${VWIFI_IFACE}
driver=nl80211 driver=${DRIVER}
hw_mode=g hw_mode=g
channel=${CHANNEL} channel=${CHANNEL}