lnxrouter for openSUSE users (tested on openSUSE tumbleweed)
This commit is contained in:
parent
e5fc9efe48
commit
55ff550cd5
|
@ -1685,55 +1685,55 @@ dealwith_mac() {
|
|||
}
|
||||
|
||||
write_hostapd_conf() {
|
||||
cat <<- EOF > "$CONFDIR/hostapd.conf"
|
||||
cat <<- EOF > "/etc/hostapd.conf"
|
||||
beacon_int=100
|
||||
ssid=${SSID}
|
||||
interface=${AP_IFACE}
|
||||
driver=${DRIVER}
|
||||
channel=${CHANNEL}
|
||||
ctrl_interface=$CONFDIR/hostapd_ctrl
|
||||
ctrl_interface_group=0
|
||||
#ctrl_interface=$CONFDIR/hostapd_ctrl
|
||||
#ctrl_interface_group=0
|
||||
ignore_broadcast_ssid=$HIDDEN
|
||||
ap_isolate=$ISOLATE_CLIENTS
|
||||
EOF
|
||||
|
||||
if [[ -n "$COUNTRY" ]]; then
|
||||
cat <<- EOF >> "$CONFDIR/hostapd.conf"
|
||||
cat <<- EOF >> "/etc/hostapd.conf"
|
||||
country_code=${COUNTRY}
|
||||
ieee80211d=1
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ $FREQ_BAND == 2.4 ]]; then
|
||||
echo "hw_mode=g" >> "$CONFDIR/hostapd.conf"
|
||||
echo "hw_mode=g" >> "/etc/hostapd.conf"
|
||||
else
|
||||
echo "hw_mode=a" >> "$CONFDIR/hostapd.conf"
|
||||
echo "hw_mode=a" >> "/etc/hostapd.conf"
|
||||
fi
|
||||
|
||||
if [[ $MAC_FILTER -eq 1 ]]; then
|
||||
cat <<- EOF >> "$CONFDIR/hostapd.conf"
|
||||
cat <<- EOF >> "/etc/hostapd.conf"
|
||||
macaddr_acl=${MAC_FILTER}
|
||||
accept_mac_file=${MAC_FILTER_ACCEPT}
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ $IEEE80211N -eq 1 ]]; then
|
||||
cat <<- EOF >> "$CONFDIR/hostapd.conf"
|
||||
cat <<- EOF >> "/etc/hostapd.conf"
|
||||
ieee80211n=1
|
||||
ht_capab=${HT_CAPAB}
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ $IEEE80211AC -eq 1 ]]; then
|
||||
echo "ieee80211ac=1" >> "$CONFDIR/hostapd.conf"
|
||||
echo "ieee80211ac=1" >> "/etc/hostapd.conf"
|
||||
fi
|
||||
|
||||
if [[ -n "$VHT_CAPAB" ]]; then
|
||||
echo "vht_capab=${VHT_CAPAB}" >> "$CONFDIR/hostapd.conf"
|
||||
echo "vht_capab=${VHT_CAPAB}" >> "/etc/hostapd.conf"
|
||||
fi
|
||||
|
||||
if [[ $IEEE80211N -eq 1 ]] || [[ $IEEE80211AC -eq 1 ]]; then
|
||||
echo "wmm_enabled=1" >> "$CONFDIR/hostapd.conf"
|
||||
echo "wmm_enabled=1" >> "/etc/hostapd.conf"
|
||||
fi
|
||||
|
||||
if [[ -n "$PASSPHRASE" ]]; then
|
||||
|
@ -1743,7 +1743,7 @@ write_hostapd_conf() {
|
|||
else
|
||||
WPA_KEY_TYPE=psk
|
||||
fi
|
||||
cat <<- EOF >> "$CONFDIR/hostapd.conf"
|
||||
cat <<- EOF >> "/etc/hostapd.conf"
|
||||
wpa=${WPA_VERSION}
|
||||
wpa_${WPA_KEY_TYPE}=${PASSPHRASE}
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
|
@ -1753,7 +1753,7 @@ write_hostapd_conf() {
|
|||
else
|
||||
echo "WARN: Wifi is not protected by password" >&2
|
||||
fi
|
||||
chmod 600 "$CONFDIR/hostapd.conf"
|
||||
chmod 600 "/etc/hostapd.conf"
|
||||
}
|
||||
|
||||
write_dnsmasq_conf() {
|
||||
|
@ -1861,7 +1861,7 @@ run_wifi_ap_processes() {
|
|||
echo
|
||||
echo "Starting hostapd"
|
||||
# hostapd '-P' works only when use '-B' (run in background)
|
||||
$STDBUF_PATH hostapd $HOSTAPD_DEBUG_ARGS -P "$CONFDIR/hostapd.pid" "$CONFDIR/hostapd.conf" &
|
||||
$STDBUF_PATH hostapd $HOSTAPD_DEBUG_ARGS -P "$CONFDIR/hostapd.pid" "/etc/hostapd.conf" &
|
||||
HOSTAPD_PID=$!
|
||||
echo "$HOSTAPD_PID" > "$CONFDIR/hostapd.pid"
|
||||
echo "hostapd PID: $HOSTAPD_PID"
|
Loading…
Reference in New Issue