If wifi interface is not wlan0 then stick with the configuration

This commit is contained in:
Bob Mottram 2015-08-09 14:45:59 +01:00
parent c37f537d39
commit 71a62ea56f
2 changed files with 19 additions and 10 deletions

View File

@ -1733,8 +1733,10 @@ function mesh_babel {
echo 'fi' >> $babel_script
echo '' >> $babel_script
echo "IFACE=$WIFI_INTERFACE" >> $babel_script
echo 'if grep -q "wlan1" /proc/net/dev; then' >> $babel_script
echo ' IFACE=wlan1' >> $babel_script
echo 'if [[ $IFACE == "wlan0" ]]; then' >> $babel_script
echo ' if grep -q "wlan1" /proc/net/dev; then' >> $babel_script
echo ' IFACE=wlan1' >> $babel_script
echo ' fi' >> $babel_script
echo 'fi' >> $babel_script
echo '' >> $babel_script
echo 'if [[ ! grep -q "$IFACE" /proc/net/dev || $1 == "stop" ]]; then' >> $babel_script
@ -1828,8 +1830,10 @@ function mesh_batman_bridge {
echo "IFACE=$WIFI_INTERFACE" >> $batman_script
echo 'EIFACE=eth0' >> $batman_script
echo '' >> $batman_script
echo 'if grep -q "wlan1" /proc/net/dev; then' >> $batman_script
echo ' IFACE=wlan1' >> $batman_script
echo 'if [[ $IFACE == "wlan0" ]]; then' >> $batman_script
echo ' if grep -q "wlan1" /proc/net/dev; then' >> $batman_script
echo ' IFACE=wlan1' >> $batman_script
echo ' fi' >> $batman_script
echo 'fi' >> $batman_script
echo '' >> $batman_script
echo 'if [ -e /etc/default/batctl ]; then' >> $batman_script

View File

@ -32,6 +32,7 @@ CURR_USER=$USER
VERSION="1.01"
WIFI_CHANNEL=2
WIFI_INTERFACE=wlan0
# B.A.T.M.A.N settings
BATMAN_CELLID='02:BA:00:00:03:01'
@ -124,9 +125,11 @@ function mesh_babel {
echo ' fi' >> $babel_script
echo 'fi' >> $babel_script
echo '' >> $babel_script
echo 'IFACE=wlan0' >> $babel_script
echo 'if grep -q "wlan1" /proc/net/dev; then' >> $babel_script
echo ' IFACE=wlan1' >> $babel_script
echo "IFACE=$WIFI_INTERFACE" >> $babel_script
echo 'if [[ $IFACE == "wlan0" ]]; then' >> $babel_script
echo ' if grep -q "wlan1" /proc/net/dev; then' >> $babel_script
echo ' IFACE=wlan1' >> $babel_script
echo ' fi' >> $babel_script
echo 'fi' >> $babel_script
echo '' >> $babel_script
echo 'if [[ ! grep -q "$IFACE" /proc/net/dev || $1 == "stop" ]]; then' >> $babel_script
@ -191,11 +194,13 @@ function mesh_batman {
echo '' >> $batman_script
echo '# Ethernet bridge definition (bridged to bat0)' >> $batman_script
echo 'BRIDGE=br-mesh' >> $batman_script
echo 'IFACE=wlan0' >> $batman_script
echo "IFACE=$WIFI_INTERFACE" >> $batman_script
echo 'EIFACE=eth0' >> $batman_script
echo '' >> $batman_script
echo 'if grep -q "wlan1" /proc/net/dev; then' >> $batman_script
echo ' IFACE=wlan1' >> $batman_script
echo 'if [[ $IFACE == "wlan0" ]]; then' >> $batman_script
echo ' if grep -q "wlan1" /proc/net/dev; then' >> $batman_script
echo ' IFACE=wlan1' >> $batman_script
echo ' fi' >> $batman_script
echo 'fi' >> $batman_script
echo '' >> $batman_script
echo 'if [ -e /etc/default/batctl ]; then' >> $batman_script