Removed old code, fixed typos, set interfaces correctly

This commit is contained in:
floh1111 2011-12-25 20:11:24 +00:00
parent 468193f4a9
commit dbfb7e5ad5
10 changed files with 14 additions and 52 deletions

View File

@ -20,14 +20,11 @@ if [ -f /etc/config/configurator ];then
CRAWL_NICKNAME=`uci get configurator.@crawl[0].nickname`
CRAWL_PASSWORD=`uci get configurator.@crawl[0].password`
UPDATE_AUTOUPDATE=`uci get configurator.@update[0].autoupdate`
MESH_INTERFACE=`uci get configurator.@network[0].mesh_interface`
CLIENT_INTERFACES=`uci get configurator.@network[0].client_interfaces`
AUTOADD_IPV6_ADDRESS=`uci get configurator.@netmon[0].autoadd_ipv6_address`
else
. $SCRIPT_DIR/configurator_config
fi
API_RETRY=$(($API_RETRY - 1))
get_url() {

View File

@ -20,23 +20,6 @@ else
. $SCRIPT_DIR/nodewatcher_config
fi
#Set default values if nothing is set
if [ -n $API_TIMEOUT ]; then
API_TIMEOUT="5"
fi
if [ -n $API_RETRY ]; then
API_RETRY="5"
fi
if [ -n $MESH_INTERFACE ]; then
MESH_INTERFACE="br-mesh"
fi
if [ -n $CLIENT_INTERFACES ]; then
CLIENT_INTERFACES="ath0 wlan0"
fi
if [ -n $SCRIPT_SYNC_HOSTNAME ]; then
SCRIPT_SYNC_HOSTNAME="1"
fi
API_RETRY=$(($API_RETRY - 1))
delete_log() {
@ -299,21 +282,8 @@ crawl() {
DATA="<?xml version='1.0' standalone='yes'?><data><system_data>$SYSTEM_DATA</system_data><interface_data>$INTERFACE_DATA</interface_data><batman_adv_interfaces>$BATMAN_ADV_INTERFACES</batman_adv_interfaces><batman_adv_originators>$BATMAN_ADV_ORIGINATORS</batman_adv_originators><client_count>$CLIENT_DATA</client_count></data>"
#Send system data
#write data to hxml file that provides the data on httpd
echo $DATA > /tmp/node.data
if [[ $SCRIPT_SYNC_HOSTNAME = "1" ]]; then
netmon_hostname="`echo $api_return | cut '-d;' -f2`"
if [ "$netmon_hostname" != "" ]; then
if [ "$netmon_hostname" != "`cat /proc/sys/kernel/hostname`" ]; then
if [ $error_level -gt "1" ]; then
echo "`date`: Setze neuen Hostname (Hostname synchronisation)" >> $logfile
fi
uci set system.@system[0].hostname=$netmon_hostname
uci commit
echo $netmon_hostname > /proc/sys/kernel/hostname
fi
fi
fi
}
LANG=C

View File

@ -4,7 +4,7 @@ config 'interface' 'loopback'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'
config 'interface' 'wlanmesch'
config 'interface' 'wlanmesh'
option 'ifname' 'wlan1'
option 'mtu' '1528'

View File

@ -11,7 +11,7 @@ config wifi-device radio0
config wifi-iface
option device radio0
option network wlan
option network wlanmesh
option mode adhoc
option bssid '02:CA:FF:EE:BA:BE'
option ssid 'batman.oldenburg.freifunk.net'
@ -20,6 +20,6 @@ config wifi-iface
config wifi-iface
option device radio0
option network wlan
option network mesh
option mode ap
option ssid 'oldenburg.freifunk.net'

View File

@ -17,9 +17,4 @@
#* * * * * /usr/sbin/ff_olsr_test_gw
#*/5 * * * * /usr/sbin/ff_olsr_watchdog
#0 */4 * * * /usr/sbin/ff_rdate
#17 * * * * /usr/sbin/ff_mapupdate
#Fix only for WR1043ND because wlan0 is not added after bootup
*/5 * * * * brctl addif br-mesh wlan0
#Fix only for WR1043ND because mtu of wlan1 is not set bootup
*/5 * * * * ifconfig wlan1 mtu 1527
#17 * * * * /usr/sbin/ff_mapupdate

View File

@ -8,6 +8,9 @@ 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

View File

@ -4,7 +4,7 @@ config 'interface' 'loopback'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'
config 'interface' 'wlanmesch'
config 'interface' 'wlanmesh'
option 'ifname' 'wlan1'
option 'mtu' '1528'

View File

@ -13,7 +13,7 @@ config wifi-device radio0
config wifi-iface
option device radio0
option network wlan
option network wlanmesh
option mode adhoc
option bssid '02:CA:FF:EE:BA:BE'
option ssid 'batman.oldenburg.freifunk.net'
@ -24,7 +24,7 @@ config wifi-iface
config wifi-iface
option device radio0
option network wlan
option network mesh
option mode ap
option ssid 'oldenburg.freifunk.net'
option 'encryption' 'none'

View File

@ -17,9 +17,4 @@
#* * * * * /usr/sbin/ff_olsr_test_gw
#*/5 * * * * /usr/sbin/ff_olsr_watchdog
#0 */4 * * * /usr/sbin/ff_rdate
#17 * * * * /usr/sbin/ff_mapupdate
#Fix only for WR1043ND because wlan0 is not added after bootup
*/5 * * * * brctl addif br-mesh wlan0
#Fix only for WR1043ND because mtu of wlan1 is not set bootup
*/5 * * * * ifconfig wlan1 mtu 1527
#17 * * * * /usr/sbin/ff_mapupdate

View File

@ -8,6 +8,8 @@ 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