original interfaces file

This commit is contained in:
Bob Mottram 2016-04-21 12:55:55 +01:00
parent af37d67bb2
commit 1189d07005
1 changed files with 7 additions and 5 deletions

View File

@ -58,8 +58,8 @@ function hotspot_off {
rm /etc/hostapd/hostapd.conf
if [ -f /etc/network/interfaces_old ]; then
cp /etc/network/interfaces_old /etc/network/interfaces
if [ -f /etc/network/interfaces_original ]; then
cp /etc/network/interfaces_original /etc/network/interfaces
else
echo '# interfaces(5) file used by ifup(8) and ifdown(8)' > /etc/network/interfaces
echo '# Include files from /etc/network/interfaces.d:' >> /etc/network/interfaces
@ -110,9 +110,11 @@ function hotspot_on {
echo '## Accept all MAC address ###' >> /etc/hostapd/hostapd.conf
echo 'macaddr_acl=0' >> /etc/hostapd/hostapd.conf
if ! grep -q "# Hotspot" /etc/network/interfaces; then
cp /etc/network/interfaces /etc/network/interfaces_old
fi
if [ ! -f /etc/network/interfaces_original ]; then
if ! grep -q "# Hotspot" /etc/network/interfaces; then
cp /etc/network/interfaces /etc/network/interfaces_original
fi
fi
echo '# Hotspot' > /etc/network/interfaces
echo 'auto lo br0' >> /etc/network/interfaces