From bbe54431f1ad98f06df4d7a7e366cd256a6c8e16 Mon Sep 17 00:00:00 2001 From: floh1111 Date: Sat, 24 Mar 2012 16:28:17 +0000 Subject: [PATCH] Add workaround for bridge fuckup --- root_file_system/default/etc/configurator.sh | 5 +++++ root_file_system/default/etc/downup.sh | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 root_file_system/default/etc/downup.sh diff --git a/root_file_system/default/etc/configurator.sh b/root_file_system/default/etc/configurator.sh index ee4a783..567c9f5 100644 --- a/root_file_system/default/etc/configurator.sh +++ b/root_file_system/default/etc/configurator.sh @@ -104,6 +104,11 @@ assign_router() { echo "`date`: The list of not assigned routers has been updated. Exiting" >> $SCRIPT_LOGFILE exit 0 fi + else + if [ $SCRIPT_ERROR_LEVEL -gt "0" ]; then + echo "`date`: An unknown error occured" >> $SCRIPT_LOGFILE + exit 0 + fi fi if [ $SCRIPT_ERROR_LEVEL -gt "0" ]; then echo "`date`: The router has not been assigned to a router in Netmon" >> $SCRIPT_LOGFILE diff --git a/root_file_system/default/etc/downup.sh b/root_file_system/default/etc/downup.sh new file mode 100644 index 0000000..556d341 --- /dev/null +++ b/root_file_system/default/etc/downup.sh @@ -0,0 +1,19 @@ +ipv6_link_local_addr="`ifconfig br-mesh | grep 'inet6 addr:' | grep 'Scope:Link' | awk '{ print $3}'`" + +ipv6_link_local_addr="`echo $ipv6_link_local_addr | cut -d/ -f1`" + +ping_result="`ping6 -I br-mesh $ipv6_link_local_addr`" + +ping_result="`echo $ping_result | grep 'bad address'`" + +ping_result="`$ping_result | awk '{ print $2}'`" + +echo $ping_result + +if [ "$ping_result"=="ping6\: sendto\: Cannot assign requested address" ]; then + echo "down" + ifconfig br-mesh down + ifconfig br-mesh up +else + echo "up" +fi