From 55ff550cd5d7c8891b573c67cdd22e3132599162 Mon Sep 17 00:00:00 2001 From: Gabriel Evan Date: Thu, 1 Jul 2021 19:09:49 +0700 Subject: [PATCH] lnxrouter for openSUSE users (tested on openSUSE tumbleweed) --- lnxrouter => lnxrouter-openSUSE | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) rename lnxrouter => lnxrouter-openSUSE (99%) diff --git a/lnxrouter b/lnxrouter-openSUSE similarity index 99% rename from lnxrouter rename to lnxrouter-openSUSE index 064c1d3..4ffccf0 100755 --- a/lnxrouter +++ b/lnxrouter-openSUSE @@ -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"