Compare commits
4 Commits
33337c39a2
...
45b53ce8e5
Author | SHA1 | Date |
---|---|---|
|
45b53ce8e5 | |
|
fe2348a725 | |
|
7b374d1ee1 | |
|
77b4189d97 |
25
lnxrouter
25
lnxrouter
|
@ -99,6 +99,8 @@ Options:
|
|||
--mac-filter Enable WiFi hotspot MAC address filtering
|
||||
--mac-filter-accept Location of WiFi hotspot MAC address filter list
|
||||
(defaults to /etc/hostapd/hostapd.accept)
|
||||
--redirect-to-localhost If -n is set, redirect every web request to
|
||||
localhost (useful for public information networks)
|
||||
--hostapd-debug <level> 1 or 2. Passes -d or -dd to hostapd
|
||||
--isolate-clients Disable wifi communication between clients
|
||||
--no-haveged Do not run haveged automatically when needed
|
||||
|
@ -208,6 +210,7 @@ define_global_variables(){
|
|||
FREQ_BAND=2.4
|
||||
NO_HAVEGED=0
|
||||
HOSTAPD_DEBUG_ARGS=
|
||||
REDIRECT_TO_LOCALHOST=0
|
||||
USE_PSK=0
|
||||
ISOLATE_CLIENTS=0
|
||||
QR=0 # show wifi qr
|
||||
|
@ -484,6 +487,10 @@ parse_user_options(){
|
|||
fi
|
||||
shift
|
||||
;;
|
||||
--redirect-to-localhost)
|
||||
shift
|
||||
REDIRECT_TO_LOCALHOST=1
|
||||
;;
|
||||
--psk)
|
||||
shift
|
||||
USE_PSK=1
|
||||
|
@ -2033,6 +2040,12 @@ write_dnsmasq_conf() {
|
|||
echo log-queries=extra >> "$CONFDIR/dnsmasq.conf"
|
||||
fi
|
||||
|
||||
if [[ "$SHARE_METHOD" == "none" && "$REDIRECT_TO_LOCALHOST" == "1" ]]; then
|
||||
cat <<EOF >>$CONFDIR/dnsmasq.conf
|
||||
address=/#/$GATEWAY
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ $DNS ]]; then
|
||||
DNS_count=$(echo "$DNS" | awk -F, '{print NF}')
|
||||
for (( i=1;i<=DNS_count;i++ )); do
|
||||
|
@ -2087,8 +2100,9 @@ run_wifi_ap_processes() {
|
|||
echo
|
||||
echo "Starting hostapd"
|
||||
|
||||
if which complain > /dev/null 2>&1; then
|
||||
complain hostapd
|
||||
if COMPLAIN_CMD="$(command -v aa-complain || command -v complain)"; then
|
||||
echo "Setting hostapd to AppArmor complain mode..."
|
||||
"$COMPLAIN_CMD" hostapd
|
||||
fi
|
||||
|
||||
# hostapd '-P' works only when use '-B' (run in background)
|
||||
|
@ -2108,10 +2122,9 @@ start_dnsmasq() {
|
|||
echo
|
||||
echo "Starting dnsmasq"
|
||||
|
||||
if which complain > /dev/null 2>&1; then
|
||||
# openSUSE's apparmor does not allow dnsmasq to read files.
|
||||
# remove restriction.
|
||||
complain dnsmasq
|
||||
if COMPLAIN_CMD="$(command -v aa-complain || command -v complain)"; then
|
||||
echo "Setting dnsmasq to AppArmor complain mode..."
|
||||
"$COMPLAIN_CMD" dnsmasq
|
||||
fi
|
||||
|
||||
# Using '-d'(no daemon) dnsmasq will not turn into 'nobody'
|
||||
|
|
Loading…
Reference in New Issue