adding function to switch DNS nameservers + monitoring of current settings; adding a README

This commit is contained in:
2016-12-26 15:30:59 +01:00
parent 5b233c5b1a
commit 9d605278e7
4 changed files with 118 additions and 3 deletions

View File

@@ -15,11 +15,13 @@ function isonline {
fi
}
# connection status
TOOL="$TOOL;conn=$var_conn"
# NUMBER OF UNSENT EMAILS
function check_mailqueue {
QUEUE=$($MSMTP_LIST | grep -o "^From: " | wc -l)
OUT="$OUT;mq=$QUEUE"
TOOL="$TOOL;conn=$var_conn"
# If $QUEUE > 0 and >10 runs, show notification
if [ "$QUEUE" -gt 0 ]; then
@@ -52,10 +54,23 @@ function check_svn {
TOOL="$TOOL;svn=$SVN_REV"
}
# NAMESERVER STATUS
function check_ns {
FIRSTNS=$(grep -m1 "^nameserver" /etc/resolv.conf | cut -d" " -f2) # first nameserver in /etc/resolv.conf
if [ "$var_ns" == "" ]; then # var_ns is only set with status-interaction.sh, no default value in config.cfg
OUT="$OUT;ns=default"
else
OUT="$OUT;ns=$var_ns"
fi
TOOL="$TOOL;ns=$FIRSTNS..."
}
# OUTPUT INFO ON STATUSBAR
check_mailqueue
check_svn
check_ns
# Replace ; by | to make it look nicely
OUT=$(echo $OUT | sed -r 's/^;//')
OUT=$(echo $OUT | sed -r 's/;/ \| /g')
TOOL=$(echo $TOOL | sed -r 's/^;//')