#! /bin/sh uplink=$(grep ^uplink= /etc/musiikki.conf|sed 's/.*=\(.*\)/\1/') if [ -z "$uplink" ] then exit fi read name read essid read password logger -t musiikki "New ESSID $essid" ifdown ${uplink} > /dev/null 2>&1 rm -f /etc/network/interfaces.d/uplink.conf cat < /etc/network/interfaces.d/upstream_${name}.conf auto ${uplink} iface ${uplink} inet dhcp wpa-driver wext wpa-scan-ssid 1 wpa-proto WPA RSN wpa-key-mgmt WPA-PSK wpa-pairwise CCMP TKIP wpa-group CCMP TKIP wpa-ssid ${essid} wpa-psk ${psk} up iptables-restore < /srv/musiikki/iptables_nat.conf EOS cd /etc/network/interfaces.d ln -s upstream_${name}.conf uplink.conf ifup ${uplink} > /dev/null 2>&1