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
|
||||
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
|
||||
|
|
|
@ -99,13 +99,11 @@ cp -f dhcpd.conf /etc/dhcp/dhcpd.conf
|
|||
|
||||
#hostapd config
|
||||
cp -f hostapd.conf /etc/hostapd/hostapd.conf
|
||||
cp -f hostapd-edimax.conf /etc/hostapd/hostapd-edimax.conf
|
||||
|
||||
#hostapd manager script
|
||||
cp -f hostapd_manager.sh /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
|
||||
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
|
||||
|
@ -137,7 +135,8 @@ chmod 755 /usr/bin/fancontrol
|
|||
cp -f isc-dhcp-server /etc/default/isc-dhcp-server
|
||||
|
||||
#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
|
||||
cp -f 10-stratux.rules /etc/udev/rules.d
|
||||
|
|
|
@ -24,7 +24,6 @@ wLog "Running Stratux WiFI Script."
|
|||
|
||||
function hostapd-upgrade {
|
||||
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=')
|
||||
|
||||
wLog "Moving existing values from $DAEMON_CONF to $DAEMON_USER_PREF if found"
|
||||
|
@ -34,7 +33,6 @@ function hostapd-upgrade {
|
|||
then
|
||||
grep "^$i" $DAEMON_CONF >> $DAEMON_USER_PREF
|
||||
sed -i '/^'"$i"'/d' $DAEMON_CONF
|
||||
sed -i '/^'"$i"'/d' $DAEMON_CONF_EDIMAX
|
||||
fi
|
||||
done
|
||||
sleep 1 #make sure there is time to get the file written before checking for it again
|
||||
|
@ -53,43 +51,30 @@ function hostapd-upgrade {
|
|||
function ap-start {
|
||||
|
||||
# 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 "
|
||||
/usr/bin/killall hostapd hostapd-edimax
|
||||
/usr/bin/killall hostapd
|
||||
sleep 1
|
||||
/usr/bin/killall -9 hostapd hostapd-edimax
|
||||
/usr/bin/killall -9 hostapd
|
||||
wLog "Stopping DHCP services "
|
||||
/usr/sbin/service isc-dhcp-server stop
|
||||
/bin/systemctl stop isc-dhcp-server
|
||||
|
||||
|
||||
#EDIMAX Mac Addresses from http://www.adminsub.net/mac-address-finder/edimax
|
||||
#for logic check all addresses must be lowercase
|
||||
# 74:da:38 is my MAC on my NANO
|
||||
edimaxMac=(80:1f:02 74:da:38 00:50:fc 00:1f:1f 00:0e:2e 00:00:b4)
|
||||
# Sometimes the PID file seems to remain and dhcpd becomes unable to start again?
|
||||
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868240
|
||||
sleep 1
|
||||
/usr/bin/killall -9 dhcpd
|
||||
rm /var/run/dhcpd.pid
|
||||
|
||||
#Assume PI3 settings
|
||||
DAEMON_CONF=/etc/hostapd/hostapd.conf
|
||||
DAEMON_SBIN=/usr/sbin/hostapd
|
||||
|
||||
# Location of temporary hostapd.conf built by combining
|
||||
# non-editable /etc/hostapd/hostapd.conf or hostapd-edimax.conf
|
||||
# and the user configurable /etc/hostapd/hostapd.conf
|
||||
# non-editable /etc/hostapd/hostapd.conf
|
||||
# and the user configurable /etc/hostapd/hostapd.user
|
||||
DAEMON_TMP=/tmp/hostapd.conf
|
||||
|
||||
#get the first 3 octets of the MAC(XX:XX:XX) at wlan0
|
||||
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
|
||||
#Make a new hostapd conf file based on logic above
|
||||
cat ${DAEMON_USER_PREF} <(echo) ${DAEMON_CONF} > ${DAEMON_TMP}
|
||||
|
||||
${DAEMON_SBIN} -B ${DAEMON_TMP}
|
||||
|
@ -98,7 +83,7 @@ function ap-start {
|
|||
|
||||
wLog "Restarting DHCP services"
|
||||
|
||||
/usr/sbin/service isc-dhcp-server start
|
||||
/bin/systemctl restart isc-dhcp-server
|
||||
}
|
||||
##### End Hostapd driver check function #####
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue