diff --git a/bsp/default/root_file_system/etc/config/configurator b/bsp/default/root_file_system/etc/config/configurator.tpl similarity index 84% rename from bsp/default/root_file_system/etc/config/configurator rename to bsp/default/root_file_system/etc/config/configurator.tpl index 89c0c78..28acbf2 100644 --- a/bsp/default/root_file_system/etc/config/configurator +++ b/bsp/default/root_file_system/etc/config/configurator.tpl @@ -7,7 +7,7 @@ config 'script' config 'api' option 'ipv4_address' '1' option 'ipv6_interface' 'br-mesh' - option 'ipv6_address' 'fe80::201:2ff:fe03:405' + option 'ipv6_address' '${NETMON_IP}' option 'timeout' '5' option 'retry' '5' option 'api_key' '1' @@ -21,4 +21,4 @@ config 'crawl' option 'update_hash' '1' config 'netmon' - option 'autoadd_ipv6_address' '1' \ No newline at end of file + option 'autoadd_ipv6_address' '1' diff --git a/bsp/default/root_file_system/etc/config/wireless b/bsp/default/root_file_system/etc/config/wireless deleted file mode 100644 index 548117b..0000000 --- a/bsp/default/root_file_system/etc/config/wireless +++ /dev/null @@ -1,23 +0,0 @@ -config 'wifi-device' 'wifi0' - option 'type' 'atheros' - option 'disabled' '0' - option 'channel' '6' - option 'bgscan' '0' - option 'diversity' '1' - option 'hwmode' '11g' - -config 'wifi-iface' - option 'device' 'wifi0' - option 'network' 'wlanmesh' - option 'mode' 'adhoc' - option 'ssid' 'batman.oldenburg.freifunk.net' - option 'bssid' '02:CA:FF:EE:BA:BE' - option 'encryption' 'none' - option 'hidden' '1' - -config 'wifi-iface' - option 'device' 'wifi0' - option 'network' 'mesh' - option 'mode' 'ap' - option 'ssid' 'oldenburg.freifunk.net' - option 'encryption' 'none' diff --git a/bsp/wr841nd7/root_file_system/etc/config/wireless b/bsp/default/root_file_system/etc/config/wireless.tpl similarity index 73% rename from bsp/wr841nd7/root_file_system/etc/config/wireless rename to bsp/default/root_file_system/etc/config/wireless.tpl index acc7e2b..80f5018 100644 --- a/bsp/wr841nd7/root_file_system/etc/config/wireless +++ b/bsp/default/root_file_system/etc/config/wireless.tpl @@ -1,6 +1,6 @@ config wifi-device radio0 option type mac80211 - option channel 6 + option channel ${BATMAN_CHANNEL} option phy phy0 option hwmode 11ng @@ -8,8 +8,8 @@ config wifi-iface option device radio0 option network wlanmesh option mode adhoc - option bssid '02:CA:FF:EE:BA:BE' - option ssid 'batman.oldenburg.freifunk.net' + option bssid '${BSSID_MESH}' + option ssid '${ESSID_MESH}' option mcast_rate 6000 # option bintval 1000 option 'encryption' 'none' @@ -19,5 +19,5 @@ config wifi-iface option device radio0 option network mesh option mode ap - option ssid 'oldenburg.freifunk.net' + option ssid '${ESSID_AP}' option 'encryption' 'none' diff --git a/bsp/default/root_file_system/etc/fastdstart.sh b/bsp/default/root_file_system/etc/fastdstart.sh.tpl similarity index 90% rename from bsp/default/root_file_system/etc/fastdstart.sh rename to bsp/default/root_file_system/etc/fastdstart.sh.tpl index fdbe25f..48949b6 100755 --- a/bsp/default/root_file_system/etc/fastdstart.sh +++ b/bsp/default/root_file_system/etc/fastdstart.sh.tpl @@ -3,7 +3,11 @@ SERVER="no" #SERVERNAME="--servername--" +<<<<<<< HEAD:bsp/default/root_file_system/etc/fastdstart.sh project="ffol" +======= +project="${VPN_PROJECT}" +>>>>>>> 8804270... buildscript: support community file with templates:bsp/default/root_file_system/etc/fastdstart.sh.tpl test_internet_host1="mastersword.de" test_internet_host2="109.163.229.254" @@ -67,7 +71,7 @@ if ping -w5 -c3 "$test_internet_host1" &>/dev/null || fi # register - wget -T15 "http://mastersword.de/~reddog/fastd/?name=$hostname&port=$port&key=$pubkey" -O /tmp/fastd_${project}_output + wget -T15 "http://mastersword.de/~reddog/${project}/?name=$hostname&port=$port&key=$pubkey" -O /tmp/fastd_${project}_output filenames=$(awk '/^####/ { gsub(/^####/, "", $0); gsub(/.conf/, "", $0); print $0; }' /tmp/fastd_${project}_output) for file in $filenames; do diff --git a/bsp/default/root_file_system/etc/rc.local b/bsp/default/root_file_system/etc/rc.local deleted file mode 100755 index c523c08..0000000 --- a/bsp/default/root_file_system/etc/rc.local +++ /dev/null @@ -1,46 +0,0 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment - -# todo: all devices or only dir300 ? -if uci get network.mesh.macaddr -then - echo "MAC is set already" -else - BRMAC=$(awk '{ tolower($0); print }' /sys/class/net/br-mesh/address) - WLMAC=$(awk '{ tolower($0); print }' /sys/class/net/wlan0/address) - ETMAC=$(awk '{ tolower($0); print }' /sys/class/net/eth0/address) - - if [ "$WLMAC" != "" ] && [ "$BRMAC" != "" ] && [ "$BRMAC" = "$ETMAC" ]; then - if [[ "$BRMAC" != "$WLMAC" ]]; then - echo "Fixing wrong MAC on br-mesh" - uci set network.mesh.macaddr=$WLMAC - uci commit - ifconfig br-mesh hw ether $WLMAC - ifconfig br-mesh down - ifconfig br-mesh up - #wait before reboot to generate tinc certificates and to be able - #to login over ssh bevore reboot in case of errors - fi - fi -fi - -batctl if add wlan0-1 -batctl if add br-ethmesh1 -batctl if add br-ethmesh2 - -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -. /etc/firewall.user - -/etc/init.d/qos disable -/etc/init.d/qos stop - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -exit 0 diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl new file mode 100755 index 0000000..a6ad01a --- /dev/null +++ b/bsp/default/root_file_system/etc/rc.local.tpl @@ -0,0 +1,21 @@ +# Put your custom commands here that should be executed once +# the system init finished. By default this file does nothing. + +# collect environment info and write to dot-script +/etc/environment.sh > /tmp/environment + +. /etc/rc.local.board + +# Starting NTP-Client Daemon +ntpd -p ${NTPD_IP} + +. /etc/firewall.user + +/etc/init.d/qos disable +/etc/init.d/qos stop + +#busybox-httpd for crawldata +mkdir /tmp/crawldata +httpd -h /tmp/crawldata + +exit 0 diff --git a/bsp/dir300/root_file_system/etc/config/wireless b/bsp/dir300/root_file_system/etc/config/wireless.tpl similarity index 72% rename from bsp/dir300/root_file_system/etc/config/wireless rename to bsp/dir300/root_file_system/etc/config/wireless.tpl index da2ed64..8c6019f 100644 --- a/bsp/dir300/root_file_system/etc/config/wireless +++ b/bsp/dir300/root_file_system/etc/config/wireless.tpl @@ -2,15 +2,15 @@ config 'wifi-device' 'wifi0' option 'type' 'mac80211' option 'phy' 'phy0' option 'disabled' '0' - option 'channel' '6' + option 'channel' '${BATMAN_CHANNEL}' option 'hwmode' '11g' config 'wifi-iface' option 'device' 'wifi0' option 'network' 'wlanmesh' option 'mode' 'adhoc' - option 'ssid' 'batman.oldenburg.freifunk.net' - option 'bssid' '02:CA:FF:EE:BA:BE' + option 'ssid' '${ESSID_MESH}' + option 'bssid' '${BSSID_MESH}' option 'encryption' 'none' option 'hidden' '1' @@ -18,5 +18,5 @@ config 'wifi-iface' option 'device' 'wifi0' option 'network' 'mesh' option 'mode' 'ap' - option 'ssid' 'oldenburg.freifunk.net' + option 'ssid' '${ESSID_AP}' option 'encryption' 'none' diff --git a/bsp/dir300/root_file_system/etc/rc.local b/bsp/dir300/root_file_system/etc/rc.local.board similarity index 73% rename from bsp/dir300/root_file_system/etc/rc.local rename to bsp/dir300/root_file_system/etc/rc.local.board index 0bb6ba3..b0f1f73 100755 --- a/bsp/dir300/root_file_system/etc/rc.local +++ b/bsp/dir300/root_file_system/etc/rc.local.board @@ -1,10 +1,4 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment - -# todo: all devices or only dir300 ? if uci get network.mesh.macaddr then echo "MAC is set already" @@ -43,13 +37,3 @@ fi batctl if add wlan0-1 batctl if add eth0.3 -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -#. /etc/firewall.user - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -exit 0 diff --git a/bsp/fonera/root_file_system/etc/config/wireless b/bsp/fonera/root_file_system/etc/config/wireless.tpl similarity index 72% rename from bsp/fonera/root_file_system/etc/config/wireless rename to bsp/fonera/root_file_system/etc/config/wireless.tpl index 00c2f2f..8c6019f 100644 --- a/bsp/fonera/root_file_system/etc/config/wireless +++ b/bsp/fonera/root_file_system/etc/config/wireless.tpl @@ -2,15 +2,15 @@ config 'wifi-device' 'wifi0' option 'type' 'mac80211' option 'phy' 'phy0' option 'disabled' '0' - option 'channel' '6' + option 'channel' '${BATMAN_CHANNEL}' option 'hwmode' '11g' config 'wifi-iface' option 'device' 'wifi0' option 'network' 'wlanmesh' option 'mode' 'adhoc' - option 'ssid' 'batman.oldenburg.freifunk.net' - option 'bssid' '02:CA:FF:EE:BA:BE' + option 'ssid' '${ESSID_MESH}' + option 'bssid' '${BSSID_MESH}' option 'encryption' 'none' option 'hidden' '1' @@ -18,6 +18,5 @@ config 'wifi-iface' option 'device' 'wifi0' option 'network' 'mesh' option 'mode' 'ap' - option 'ssid' 'oldenburg.freifunk.net' + option 'ssid' '${ESSID_AP}' option 'encryption' 'none' - diff --git a/bsp/fonera/root_file_system/etc/rc.local b/bsp/fonera/root_file_system/etc/rc.local.board similarity index 66% rename from bsp/fonera/root_file_system/etc/rc.local rename to bsp/fonera/root_file_system/etc/rc.local.board index 37cf199..46054ef 100755 --- a/bsp/fonera/root_file_system/etc/rc.local +++ b/bsp/fonera/root_file_system/etc/rc.local.board @@ -1,15 +1,3 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment - -#. /etc/firewall.user - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - # fonera to slow? sleep 10 @@ -36,7 +24,3 @@ fi batctl if add wlan0-1 -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -exit 0 diff --git a/bsp/wr1043nd/root_file_system/etc/config/wireless b/bsp/wr1043nd/root_file_system/etc/config/wireless deleted file mode 100644 index d136495..0000000 --- a/bsp/wr1043nd/root_file_system/etc/config/wireless +++ /dev/null @@ -1,28 +0,0 @@ -config wifi-device radio0 - option type mac80211 - option channel 6 - option phy phy0 - option hwmode 11ng - option htmode HT20 - list ht_capab SHORT-GI-40 - list ht_capab DSSS_CCK-40 - # REMOVE THIS LINE TO ENABLE WIFI: - option disabled 0 - -config wifi-iface - option device radio0 - option network wlanmesh - option mode adhoc - option bssid '02:CA:FF:EE:BA:BE' - option ssid 'batman.oldenburg.freifunk.net' - option mcast_rate 6000 -# option bintval 1000 - option 'encryption' 'none' - option 'hidden' '1' - -config wifi-iface - option device radio0 - option network mesh - option mode ap - option ssid 'oldenburg.freifunk.net' - option 'encryption' 'none' diff --git a/bsp/wr1043nd/root_file_system/etc/rc.local b/bsp/wr1043nd/root_file_system/etc/rc.local deleted file mode 100755 index 1deb6de..0000000 --- a/bsp/wr1043nd/root_file_system/etc/rc.local +++ /dev/null @@ -1,50 +0,0 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment - -#Set Mac-Addr of wr1043nd wifi interface if not right -#HARDWARE_MACADDR=`ifconfig -a wlan0 | grep 'HWaddr' | awk '{ print $5}'` -#SOFTWARE_MACADDR=`uci get wireless.@wifi-device[0].macaddr` -# -#if [[ "$HARDWARE_MACADDR" != "$SOFTWARE_MACADDR" ]]; then -# uci set wireless.@wifi-device[0].macaddr=$HARDWARE_MACADDR -# uci commit -# #wait before reboot to generate tinc certificates and to be able -# #to login over ssh bevore reboot in case of errors -# sleep 30 -# reboot -#fi - -if uci get network.ethmesh.macaddr -then - echo "MAC for ETH-BATMAN is set already" -else - echo "Fixing MAC on eth0.3 (ethmesh)" - NEW=$(awk -F: '{ printf("%02x:%02x:%02x:%02x:%02x:%02x\n", ("0x"$1)+2, "0x"$2, "0x"$3, "0x"$4, "0x"$5, "0x"$6 ) }' /sys/class/net/eth0/address) - uci set network.ethmesh.macaddr=$NEW - uci commit - ifconfig eth0.3 hw ether $NEW - ifconfig eth0.3 down - ifconfig eth0.3 up -fi - -batctl if add wlan0-1 -batctl if add eth0.3 - -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -. /etc/firewall.user - -/etc/init.d/qos disable -/etc/init.d/qos stop - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -#sh /etc/configurator.sh - -exit 0 diff --git a/bsp/wr1043nd/root_file_system/etc/rc.local.board b/bsp/wr1043nd/root_file_system/etc/rc.local.board new file mode 100755 index 0000000..a402c66 --- /dev/null +++ b/bsp/wr1043nd/root_file_system/etc/rc.local.board @@ -0,0 +1,17 @@ + +if uci get network.ethmesh.macaddr +then + echo "MAC for ETH-BATMAN is set already" +else + echo "Fixing MAC on eth0.3 (ethmesh)" + NEW=$(awk -F: '{ printf("%02x:%02x:%02x:%02x:%02x:%02x\n", ("0x"$1)+2, "0x"$2, "0x"$3, "0x"$4, "0x"$5, "0x"$6 ) }' /sys/class/net/eth0/address) + uci set network.ethmesh.macaddr=$NEW + uci commit + ifconfig eth0.3 hw ether $NEW + ifconfig eth0.3 down + ifconfig eth0.3 up +fi + +batctl if add wlan0-1 +batctl if add eth0.3 + diff --git a/bsp/wr741nd2/root_file_system/etc/config/wireless b/bsp/wr741nd2/root_file_system/etc/config/wireless deleted file mode 100644 index acc7e2b..0000000 --- a/bsp/wr741nd2/root_file_system/etc/config/wireless +++ /dev/null @@ -1,23 +0,0 @@ -config wifi-device radio0 - option type mac80211 - option channel 6 - option phy phy0 - option hwmode 11ng - -config wifi-iface - option device radio0 - option network wlanmesh - option mode adhoc - option bssid '02:CA:FF:EE:BA:BE' - option ssid 'batman.oldenburg.freifunk.net' - option mcast_rate 6000 -# option bintval 1000 - option 'encryption' 'none' - option 'hidden' '1' - -config wifi-iface - option device radio0 - option network mesh - option mode ap - option ssid 'oldenburg.freifunk.net' - option 'encryption' 'none' diff --git a/bsp/wr741nd4/root_file_system/etc/rc.local b/bsp/wr741nd2/root_file_system/etc/rc.local.board similarity index 66% rename from bsp/wr741nd4/root_file_system/etc/rc.local rename to bsp/wr741nd2/root_file_system/etc/rc.local.board index 1cec763..124430b 100755 --- a/bsp/wr741nd4/root_file_system/etc/rc.local +++ b/bsp/wr741nd2/root_file_system/etc/rc.local.board @@ -1,8 +1,3 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment #Set Mac-Addr of wr1043nd wifi interface if not right WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address) @@ -33,16 +28,3 @@ fi batctl if add wlan0-1 batctl if add eth0.3 -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -. /etc/firewall.user - -/etc/init.d/qos disable -/etc/init.d/qos stop - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -exit 0 diff --git a/bsp/wr741nd4/root_file_system/etc/config/wireless b/bsp/wr741nd4/root_file_system/etc/config/wireless deleted file mode 100644 index acc7e2b..0000000 --- a/bsp/wr741nd4/root_file_system/etc/config/wireless +++ /dev/null @@ -1,23 +0,0 @@ -config wifi-device radio0 - option type mac80211 - option channel 6 - option phy phy0 - option hwmode 11ng - -config wifi-iface - option device radio0 - option network wlanmesh - option mode adhoc - option bssid '02:CA:FF:EE:BA:BE' - option ssid 'batman.oldenburg.freifunk.net' - option mcast_rate 6000 -# option bintval 1000 - option 'encryption' 'none' - option 'hidden' '1' - -config wifi-iface - option device radio0 - option network mesh - option mode ap - option ssid 'oldenburg.freifunk.net' - option 'encryption' 'none' diff --git a/bsp/wr841nd7/root_file_system/etc/rc.local b/bsp/wr741nd4/root_file_system/etc/rc.local.board similarity index 65% rename from bsp/wr841nd7/root_file_system/etc/rc.local rename to bsp/wr741nd4/root_file_system/etc/rc.local.board index 1cec763..29c4965 100755 --- a/bsp/wr841nd7/root_file_system/etc/rc.local +++ b/bsp/wr741nd4/root_file_system/etc/rc.local.board @@ -1,8 +1,3 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment #Set Mac-Addr of wr1043nd wifi interface if not right WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address) @@ -32,17 +27,3 @@ fi batctl if add wlan0-1 batctl if add eth0.3 - -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -. /etc/firewall.user - -/etc/init.d/qos disable -/etc/init.d/qos stop - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -exit 0 diff --git a/bsp/wr841n8/root_file_system/etc/config/wireless b/bsp/wr841n8/root_file_system/etc/config/wireless deleted file mode 100644 index acc7e2b..0000000 --- a/bsp/wr841n8/root_file_system/etc/config/wireless +++ /dev/null @@ -1,23 +0,0 @@ -config wifi-device radio0 - option type mac80211 - option channel 6 - option phy phy0 - option hwmode 11ng - -config wifi-iface - option device radio0 - option network wlanmesh - option mode adhoc - option bssid '02:CA:FF:EE:BA:BE' - option ssid 'batman.oldenburg.freifunk.net' - option mcast_rate 6000 -# option bintval 1000 - option 'encryption' 'none' - option 'hidden' '1' - -config wifi-iface - option device radio0 - option network mesh - option mode ap - option ssid 'oldenburg.freifunk.net' - option 'encryption' 'none' diff --git a/bsp/wr841n8/root_file_system/etc/rc.local b/bsp/wr841n8/root_file_system/etc/rc.local.board similarity index 66% rename from bsp/wr841n8/root_file_system/etc/rc.local rename to bsp/wr841n8/root_file_system/etc/rc.local.board index ad677ae..047e45a 100755 --- a/bsp/wr841n8/root_file_system/etc/rc.local +++ b/bsp/wr841n8/root_file_system/etc/rc.local.board @@ -1,8 +1,3 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment #Set Mac-Addr of wr1043nd wifi interface if not right WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address) @@ -33,16 +28,3 @@ fi batctl if add wlan0-1 batctl if add eth1.3 -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -. /etc/firewall.user - -/etc/init.d/qos disable -/etc/init.d/qos stop - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -exit 0 diff --git a/bsp/wr741nd2/root_file_system/etc/rc.local b/bsp/wr841nd7/root_file_system/etc/rc.local.board similarity index 65% rename from bsp/wr741nd2/root_file_system/etc/rc.local rename to bsp/wr841nd7/root_file_system/etc/rc.local.board index 1cec763..29c4965 100755 --- a/bsp/wr741nd2/root_file_system/etc/rc.local +++ b/bsp/wr841nd7/root_file_system/etc/rc.local.board @@ -1,8 +1,3 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -# collect environment info and write to dot-script -/etc/environment.sh > /tmp/environment #Set Mac-Addr of wr1043nd wifi interface if not right WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address) @@ -32,17 +27,3 @@ fi batctl if add wlan0-1 batctl if add eth0.3 - -# Starting NTP-Client Daemon -ntpd -p "fe80::201:2ff:fe03:405%br-mesh" - -. /etc/firewall.user - -/etc/init.d/qos disable -/etc/init.d/qos stop - -#busybox-httpd for crawldata -mkdir /tmp/crawldata -httpd -h /tmp/crawldata - -exit 0 diff --git a/buildscript b/buildscript index a808e2a..9c1c188 100755 --- a/buildscript +++ b/buildscript @@ -53,6 +53,13 @@ prebuild() { board_prebuild + for template in $(find $target/files -name *.tpl) + do + echo "Translating $template .." + $tpl_translate $template > $(basename $template .tpl) + /bin/rm $template + done + #insert actual firware version informations into release file version=$(git describe --tags --dirty) @@ -118,29 +125,55 @@ routers() { echo " wr1043nd" } -if [ "$1" != "select" ]; then +if [ "$1" != "selectbsp" -a "$1" != "selectcommunity" ]; then if [ ! -h selected_bsp ]; then echo "Please select a Board-Support-Package using:" - echo "$0 select" + echo "$0 selectbsp" exit - else - echo "Working with $(/bin/ls -l selected_bsp | awk '{ print $11 }')" - . selected_bsp - echo - fi + fi + if [ ! -h selected_community ]; then + echo "Please select a community file using:" + echo "$0 selectcommunity" + exit + fi + echo "Working with $(/bin/ls -l selected_bsp | awk '{ print $11 }') and" \ + "$(/bin/ls -l selected_community | awk '{ print $11 }')" + . selected_bsp + tpl_translate=$(awk -F= 'BEGIN{printf("sed")} /^.+$/{printf(" -es/\\${%s}/%s/g",$1,$2)}' selected_community) + echo fi case "$1" in - "select") + "selectbsp") if [ "$2" = "help" ] || [ "$2" = "" ]; then echo "Select a Board-Support-Package:" echo echo "Usage: $0 $1 bsp" echo "bsp: " - cd bsp; /bin/ls *.bsp; cd .. + /bin/ls bsp/*.bsp else - /bin/rm -rf selected_bsp - /bin/ln -s bsp/$2 selected_bsp + if [ ! -f $2 ]; then + echo "Could not find $2" + else + /bin/rm -rf selected_bsp + /bin/ln -s $2 selected_bsp + fi + fi + ;; + "selectcommunity") + if [ "$2" = "help" ] || [ "$2" = "" ]; then + echo "Select a Community-File:" + echo + echo "Usage: $0 $1 community.cfg" + echo "community.cfg: " + /bin/ls community/*.cfg + else + if [ ! -f $2 ]; then + echo "Could not find $2" + else + /bin/rm -rf selected_community + /bin/ln -s $2 selected_community + fi fi ;; "prepare") diff --git a/community/franken.cfg b/community/franken.cfg new file mode 100644 index 0000000..6562afd --- /dev/null +++ b/community/franken.cfg @@ -0,0 +1,8 @@ +BATMAN_CHANNEL=1 +ESSID_AP=franken.freifunk.net +ESSID_MESH=batman.franken.freifunk.net +BSSID_MESH=02:CA:FF:EE:BA:BE +NETMON_IP=fe80::ff:feee:1 +VPN_PROJECT=fff +NTPD_IP=fe80::ff:feee:1%br-mesh + diff --git a/community/oldenburg.cfg b/community/oldenburg.cfg new file mode 100644 index 0000000..309aabf --- /dev/null +++ b/community/oldenburg.cfg @@ -0,0 +1,8 @@ +BATMAN_CHANNEL=6 +ESSID_AP=oldenburg.freifunk.net +ESSID_MESH=batman.oldenburg.freifunk.net +BSSID_MESH=02:CA:FF:EE:BA:BE +NETMON_IP=fe80::201:2ff:fe03:405 +VPN_PROJECT=ffol +NTPD_IP=fe80::201:2ff:fe03:405%br-mesh +