kopia lustrzana https://github.com/cyoung/stratux
remove edimax hostapd stuff completely, workaround for debian bug #868240
rodzic
2b8ff9b416
commit
0b1bdb93cd
Plik binarny nie jest wyświetlany.
|
@ -1,6 +0,0 @@
|
||||||
interface=wlan0
|
|
||||||
driver=rtl871xdrv
|
|
||||||
hw_mode=g
|
|
||||||
wme_enabled=1
|
|
||||||
ieee80211n=1
|
|
||||||
ignore_broadcast_ssid=0
|
|
|
@ -14,19 +14,4 @@ compress
|
||||||
# packages drop log rotation information into this directory
|
# packages drop log rotation information into this directory
|
||||||
include /etc/logrotate.d
|
include /etc/logrotate.d
|
||||||
|
|
||||||
# no packages own wtmp, or btmp -- we'll rotate them here
|
|
||||||
/var/log/wtmp {
|
|
||||||
missingok
|
|
||||||
monthly
|
|
||||||
create 0664 root utmp
|
|
||||||
rotate 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/var/log/btmp {
|
|
||||||
missingok
|
|
||||||
monthly
|
|
||||||
create 0660 root utmp
|
|
||||||
rotate 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# system-specific logs may be configured here
|
# system-specific logs may be configured here
|
||||||
|
|
|
@ -99,13 +99,11 @@ cp -f dhcpd.conf /etc/dhcp/dhcpd.conf
|
||||||
|
|
||||||
#hostapd config
|
#hostapd config
|
||||||
cp -f hostapd.conf /etc/hostapd/hostapd.conf
|
cp -f hostapd.conf /etc/hostapd/hostapd.conf
|
||||||
cp -f hostapd-edimax.conf /etc/hostapd/hostapd-edimax.conf
|
|
||||||
#hostapd manager script
|
#hostapd manager script
|
||||||
cp -f hostapd_manager.sh /usr/sbin/hostapd_manager.sh
|
cp -f hostapd_manager.sh /usr/sbin/hostapd_manager.sh
|
||||||
chmod 755 /usr/sbin/hostapd_manager.sh
|
chmod 755 /usr/sbin/hostapd_manager.sh
|
||||||
#hostapd
|
|
||||||
cp -f hostapd-edimax /usr/sbin/hostapd-edimax
|
|
||||||
chmod 755 /usr/sbin/hostapd-edimax
|
|
||||||
#remove hostapd startup scripts
|
#remove hostapd startup scripts
|
||||||
rm -f /etc/rc*.d/*hostapd /etc/network/if-pre-up.d/hostapd /etc/network/if-post-down.d/hostapd /etc/init.d/hostapd /etc/default/hostapd
|
rm -f /etc/rc*.d/*hostapd /etc/network/if-pre-up.d/hostapd /etc/network/if-post-down.d/hostapd /etc/init.d/hostapd /etc/default/hostapd
|
||||||
#interface config
|
#interface config
|
||||||
|
@ -137,7 +135,8 @@ chmod 755 /usr/bin/fancontrol
|
||||||
cp -f isc-dhcp-server /etc/default/isc-dhcp-server
|
cp -f isc-dhcp-server /etc/default/isc-dhcp-server
|
||||||
|
|
||||||
#sshd config
|
#sshd config
|
||||||
cp -f sshd_config /etc/ssh/sshd_config
|
# Do not copy for now. It contains many deprecated options and isn't needed.
|
||||||
|
# cp -f sshd_config /etc/ssh/sshd_config
|
||||||
|
|
||||||
#udev config
|
#udev config
|
||||||
cp -f 10-stratux.rules /etc/udev/rules.d
|
cp -f 10-stratux.rules /etc/udev/rules.d
|
||||||
|
|
|
@ -24,7 +24,6 @@ wLog "Running Stratux WiFI Script."
|
||||||
|
|
||||||
function hostapd-upgrade {
|
function hostapd-upgrade {
|
||||||
DAEMON_CONF=/etc/hostapd/hostapd.conf
|
DAEMON_CONF=/etc/hostapd/hostapd.conf
|
||||||
DAEMON_CONF_EDIMAX=/etc/hostapd/hostapd-edimax.conf
|
|
||||||
HOSTAPD_VALUES=('ssid=' 'channel=' 'auth_algs=' 'wpa=' 'wpa_passphrase=' 'wpa_key_mgmt=' 'wpa_pairwise=' 'rsn_pairwise=')
|
HOSTAPD_VALUES=('ssid=' 'channel=' 'auth_algs=' 'wpa=' 'wpa_passphrase=' 'wpa_key_mgmt=' 'wpa_pairwise=' 'rsn_pairwise=')
|
||||||
|
|
||||||
wLog "Moving existing values from $DAEMON_CONF to $DAEMON_USER_PREF if found"
|
wLog "Moving existing values from $DAEMON_CONF to $DAEMON_USER_PREF if found"
|
||||||
|
@ -34,7 +33,6 @@ function hostapd-upgrade {
|
||||||
then
|
then
|
||||||
grep "^$i" $DAEMON_CONF >> $DAEMON_USER_PREF
|
grep "^$i" $DAEMON_CONF >> $DAEMON_USER_PREF
|
||||||
sed -i '/^'"$i"'/d' $DAEMON_CONF
|
sed -i '/^'"$i"'/d' $DAEMON_CONF
|
||||||
sed -i '/^'"$i"'/d' $DAEMON_CONF_EDIMAX
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sleep 1 #make sure there is time to get the file written before checking for it again
|
sleep 1 #make sure there is time to get the file written before checking for it again
|
||||||
|
@ -55,41 +53,28 @@ function ap-start {
|
||||||
# Preliminaries. Kill off old services.
|
# Preliminaries. Kill off old services.
|
||||||
# For some reason, in buster, hostapd will not start if it was just killed. Wait two seconds..
|
# For some reason, in buster, hostapd will not start if it was just killed. Wait two seconds..
|
||||||
wLog "Killing Hostapd services "
|
wLog "Killing Hostapd services "
|
||||||
/usr/bin/killall hostapd hostapd-edimax
|
/usr/bin/killall hostapd
|
||||||
sleep 1
|
sleep 1
|
||||||
/usr/bin/killall -9 hostapd hostapd-edimax
|
/usr/bin/killall -9 hostapd
|
||||||
wLog "Stopping DHCP services "
|
wLog "Stopping DHCP services "
|
||||||
/usr/sbin/service isc-dhcp-server stop
|
/bin/systemctl stop isc-dhcp-server
|
||||||
|
|
||||||
|
# Sometimes the PID file seems to remain and dhcpd becomes unable to start again?
|
||||||
#EDIMAX Mac Addresses from http://www.adminsub.net/mac-address-finder/edimax
|
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868240
|
||||||
#for logic check all addresses must be lowercase
|
sleep 1
|
||||||
# 74:da:38 is my MAC on my NANO
|
/usr/bin/killall -9 dhcpd
|
||||||
edimaxMac=(80:1f:02 74:da:38 00:50:fc 00:1f:1f 00:0e:2e 00:00:b4)
|
rm /var/run/dhcpd.pid
|
||||||
|
|
||||||
#Assume PI3 settings
|
#Assume PI3 settings
|
||||||
DAEMON_CONF=/etc/hostapd/hostapd.conf
|
DAEMON_CONF=/etc/hostapd/hostapd.conf
|
||||||
DAEMON_SBIN=/usr/sbin/hostapd
|
DAEMON_SBIN=/usr/sbin/hostapd
|
||||||
|
|
||||||
# Location of temporary hostapd.conf built by combining
|
# Location of temporary hostapd.conf built by combining
|
||||||
# non-editable /etc/hostapd/hostapd.conf or hostapd-edimax.conf
|
# non-editable /etc/hostapd/hostapd.conf
|
||||||
# and the user configurable /etc/hostapd/hostapd.conf
|
# and the user configurable /etc/hostapd/hostapd.user
|
||||||
DAEMON_TMP=/tmp/hostapd.conf
|
DAEMON_TMP=/tmp/hostapd.conf
|
||||||
|
|
||||||
#get the first 3 octets of the MAC(XX:XX:XX) at wlan0
|
#Make a new hostapd conf file based on logic above
|
||||||
wlan0mac=$(head -c 8 /sys/class/net/wlan0/address)
|
|
||||||
|
|
||||||
# debian stretch+ will support edimax dongle natively
|
|
||||||
osver=$(cat /etc/debian_version)
|
|
||||||
|
|
||||||
# Is there an Edimax Mac Address at wlan0 and debian version is jessie
|
|
||||||
if [[ ${edimaxMac[*]} =~ "$wlan0mac" ]] && [[ "$osver" =~ ^8.* ]]; then
|
|
||||||
DAEMON_CONF=/etc/hostapd/hostapd-edimax.conf
|
|
||||||
DAEMON_SBIN=/usr/sbin/hostapd-edimax
|
|
||||||
wLog "Edimax Dongle found at WLAN0. Using Edimad conf files $DAEMON_SBIN : $DAEMON_CONF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Make a new hostapd or hostapd-edimax conf file based on logic above
|
|
||||||
cat ${DAEMON_USER_PREF} <(echo) ${DAEMON_CONF} > ${DAEMON_TMP}
|
cat ${DAEMON_USER_PREF} <(echo) ${DAEMON_CONF} > ${DAEMON_TMP}
|
||||||
|
|
||||||
${DAEMON_SBIN} -B ${DAEMON_TMP}
|
${DAEMON_SBIN} -B ${DAEMON_TMP}
|
||||||
|
@ -98,7 +83,7 @@ function ap-start {
|
||||||
|
|
||||||
wLog "Restarting DHCP services"
|
wLog "Restarting DHCP services"
|
||||||
|
|
||||||
/usr/sbin/service isc-dhcp-server start
|
/bin/systemctl restart isc-dhcp-server
|
||||||
}
|
}
|
||||||
##### End Hostapd driver check function #####
|
##### End Hostapd driver check function #####
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue