Typo fixing and using -n option for batctl
This commit is contained in:
parent
517feb4002
commit
ef3c0f8fd4
2 changed files with 5 additions and 7 deletions
|
@ -70,7 +70,7 @@ assign_router() {
|
||||||
if [ `echo $ergebnis| cut '-d;' -f1` = "success" ]; then
|
if [ `echo $ergebnis| cut '-d;' -f1` = "success" ]; then
|
||||||
router_auto_assign_login_string=`echo $ergebnis| cut '-d;' -f2`
|
router_auto_assign_login_string=`echo $ergebnis| cut '-d;' -f2`
|
||||||
if [ $SCRIPT_ERROR_LEVEL -gt "1" ]; then
|
if [ $SCRIPT_ERROR_LEVEL -gt "1" ]; then
|
||||||
echo "`date`: There alredy exists a router with this login string: $router_auto_assign_login_string" >> $SCRIPT_LOGFILE
|
echo "`date`: A router with the login string $router_auto_assign_login_string does exists. Trying to assign..." >> $SCRIPT_LOGFILE
|
||||||
fi
|
fi
|
||||||
elif [ `echo $ergebnis| cut '-d;' -f1` = "error" ]; then
|
elif [ `echo $ergebnis| cut '-d;' -f1` = "error" ]; then
|
||||||
router_auto_assign_login_string=`echo $login_strings| cut '-d;' -f1`
|
router_auto_assign_login_string=`echo $login_strings| cut '-d;' -f1`
|
||||||
|
@ -171,7 +171,7 @@ elif [ $CRAWL_METHOD == "hash" ]; then
|
||||||
sync_hostname
|
sync_hostname
|
||||||
else
|
else
|
||||||
if [ $SCRIPT_ERROR_LEVEL -gt "1" ]; then
|
if [ $SCRIPT_ERROR_LEVEL -gt "1" ]; then
|
||||||
echo "`date`: The router is alredy assigned to a router in Netmon" >> $SCRIPT_LOGFILE
|
echo "`date`: The router is already assigned to a router in Netmon" >> $SCRIPT_LOGFILE
|
||||||
fi
|
fi
|
||||||
if [[ $AUTOADD_IPV6_ADDRESS = "1" ]]; then
|
if [[ $AUTOADD_IPV6_ADDRESS = "1" ]]; then
|
||||||
autoadd_ipv6_address
|
autoadd_ipv6_address
|
||||||
|
|
|
@ -82,7 +82,7 @@ crawl() {
|
||||||
fi
|
fi
|
||||||
if which batctl >/dev/null; then
|
if which batctl >/dev/null; then
|
||||||
batctl_adv_version=`batctl -v | awk '{ print $2 }'`
|
batctl_adv_version=`batctl -v | awk '{ print $2 }'`
|
||||||
batman_adv_version=`batctl o|head -n1|awk '{ print $3 }'|sed 's/,//'`
|
batman_adv_version=`batctl o -n|head -n1|awk '{ print $3 }'|sed 's/,//'`
|
||||||
fi
|
fi
|
||||||
kernel_version=`uname -r`
|
kernel_version=`uname -r`
|
||||||
nodewatcher_version=$SCRIPT_VERSION
|
nodewatcher_version=$SCRIPT_VERSION
|
||||||
|
@ -156,7 +156,6 @@ crawl() {
|
||||||
echo "`date`: Collecting information from batman advanced and it´s interfaces" >> $SCRIPT_LOGFILE
|
echo "`date`: Collecting information from batman advanced and it´s interfaces" >> $SCRIPT_LOGFILE
|
||||||
fi
|
fi
|
||||||
#B.A.T.M.A.N. advanced
|
#B.A.T.M.A.N. advanced
|
||||||
mv /tmp/bat-hosts /tmp/bat-hosts.tmp
|
|
||||||
if which batctl >/dev/null; then
|
if which batctl >/dev/null; then
|
||||||
batman_check_running=`batctl if | grep 'Error'`
|
batman_check_running=`batctl if | grep 'Error'`
|
||||||
if [ "$batman_check_running" == "" ]; then
|
if [ "$batman_check_running" == "" ]; then
|
||||||
|
@ -174,12 +173,12 @@ crawl() {
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $has_active_interface = "1" ]; then
|
if [ $has_active_interface = "1" ]; then
|
||||||
BAT_ADV_ORIGINATORS=`batctl o | grep 'No batman nodes in range'`
|
BAT_ADV_ORIGINATORS=`batctl o -n | grep 'No batman nodes in range'`
|
||||||
if [ "$BAT_ADV_ORIGINATORS" == "" ]; then
|
if [ "$BAT_ADV_ORIGINATORS" == "" ]; then
|
||||||
OLDIFS=$IFS
|
OLDIFS=$IFS
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
BAT_ADV_ORIGINATORS=`batctl o | awk '/O/ {next} /B/ {next} {print}'`
|
BAT_ADV_ORIGINATORS=`batctl o -n | awk '/O/ {next} /B/ {next} {print}'`
|
||||||
count=0;
|
count=0;
|
||||||
for row in $BAT_ADV_ORIGINATORS; do
|
for row in $BAT_ADV_ORIGINATORS; do
|
||||||
originator=`echo $row | awk '{print $1}'`
|
originator=`echo $row | awk '{print $1}'`
|
||||||
|
@ -199,7 +198,6 @@ crawl() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
mv /tmp/bat-hosts.tmp /tmp/bat-hosts
|
|
||||||
|
|
||||||
if [ $SCRIPT_ERROR_LEVEL -gt "1" ]; then
|
if [ $SCRIPT_ERROR_LEVEL -gt "1" ]; then
|
||||||
echo "`date`: Collecting information about conected clients" >> $SCRIPT_LOGFILE
|
echo "`date`: Collecting information about conected clients" >> $SCRIPT_LOGFILE
|
||||||
|
|
Loading…
Add table
Reference in a new issue