Support uplink network management when two wlan devices are available
[infodrom/musiikki-web.git] / bin / musiikki-wlan
1 #! /bin/sh
2
3 PATH=/sbin:$PATH
4
5 uplink=$(grep ^uplink= /etc/musiikki.conf|sed 's/.*=\(.*\)/\1/')
6
7 if [ -z "$uplink" ]
8 then
9     exit
10 fi
11
12 read wlan
13
14 logger -t musiikki "WLAN: $wlan"
15
16 ifdown ${uplink} > /dev/null 2>&1
17
18 rm -f /etc/network/interfaces.d/uplink.conf
19
20 if [ -n "$wlan" ]
21 then
22     cd /etc/network/interfaces.d
23     ln -s upstream_${wlan}.conf uplink.conf
24     ifup ${uplink} > /dev/null 2>&1
25 fi