adding function to switch DNS nameservers + monitoring of current settings; adding a README
This commit is contained in:
@@ -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/^;//')
|
||||
|
||||
Reference in New Issue
Block a user