babel checks for wlan1

This commit is contained in:
Bob Mottram 2015-08-08 09:50:18 +01:00
parent c9e58f1852
commit a3503aec30
1 changed files with 9 additions and 3 deletions

View File

@ -108,10 +108,16 @@ function mesh_babel {
echo 'fi' >> $babel_script echo 'fi' >> $babel_script
echo '' >> $babel_script echo '' >> $babel_script
echo 'IFACE=wlan0' >> $babel_script echo 'IFACE=wlan0' >> $babel_script
echo 'IFACE_EXISTS=$(grep "$IFACE" /proc/net/dev)' >> $babel_script echo 'if grep -q "wlan1" /proc/net/dev; then' >> $babel_script
echo ' IFACE=wlan1' >> $babel_script
echo 'fi' >> $babel_script
echo '' >> $babel_script echo '' >> $babel_script
echo 'if [[ ! $IFACE_EXISTS || $1 == "stop" ]]; then' >> $babel_script echo 'if [[ ! grep -q "$IFACE" /proc/net/dev || $1 == "stop" ]]; then' >> $babel_script
echo ' echo "Interface $IFACE was not found"' >> $babel_script echo ' if ! grep -q "$IFACE" /proc/net/dev; then' >> $babel_script
echo ' echo "Interface $IFACE was not found"' >> $babel_script
echo ' else' >> $babel_script
echo ' echo "Stopping"' >> $babel_script
echo ' fi' >> $babel_script
echo ' ifconfig $IFACE down' >> $babel_script echo ' ifconfig $IFACE down' >> $babel_script
echo ' pkill babeld' >> $babel_script echo ' pkill babeld' >> $babel_script
echo ' if [ -f /bin/systemctl ]; then' >> $babel_script echo ' if [ -f /bin/systemctl ]; then' >> $babel_script