loading user config settings

update the file to create a tmp file that adds all the user config valuse to the hostapd.conf and uses the new /tmp/hostapd.conf to run the hostapd deamon
pull/529/head
peepsnet 2016-11-23 15:52:44 -05:00 zatwierdzone przez GitHub
rodzic 11f513c1da
commit 3cca4ba525
1 zmienionych plików z 16 dodań i 5 usunięć

Wyświetl plik

@ -8,21 +8,32 @@
# Detect RPi version.
# Per http://elinux.org/RPi_HardwareHistory
#Assume PI3 settings
DAEMON_CONF=/etc/hostapd/hostapd.conf
DAEMON_SBIN=/usr/sbin/hostapd
#User settings for hostapd.conf and hostapd-edimax.conf
DAEMON_USER_PREF=/etc/hostapd/hostapd.user
DAEMON_TMP=/tmp/hostapd.conf
EW7811Un=$(lsusb | grep EW-7811Un)
RPI_REV=`cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//'`
if [ "$RPI_REV" = "a01041" ] || [ "$RPI_REV" = "a21041" ] || [ "$RPI_REV" = "900092" ] || [ "$RPI_REV" = "900093" ] && [ "$EW7811Un" != '' ]; then
# This is a RPi2B or RPi0 with Edimax USB Wifi dongle.
DAEMON_CONF=/etc/hostapd/hostapd-edimax.conf
DAEMON_SBIN=/usr/sbin/hostapd-edimax
else
DAEMON_CONF=/etc/hostapd/hostapd.conf
DAEMON_SBIN=/etc/hostapd/hostapd-edimax
# else
# DAEMON_CONF=/etc/hostapd/hostapd.conf
fi
#Make a new hostapd or hostapd-edimax conf file based on logic above
cp -f ${DAEMON_CONF} ${DAEMON_TMP}
${DAEMON_SBIN} -B ${DAEMON_CONF}
#inject user settings from file to tmp conf
cat ${DAEMON_USER_PREF} >> ${DAEMON_TMP}
${DAEMON_SBIN} -B ${DAEMON_TMP}
sleep 5