Contains several scripts that can show information in the XFCE4 task bar (current IPs, plain output of a website, number of queued mails), and enables users to execute various actions (switch the computer to an "offline mode", send enqueued emails).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mxmehl 23cf4050b1
try max. 2 times * 5 secs
1 year ago
.gitignore initial commit 3 years ago
LICENSE add license 3 years ago
README.md fix typo 2 years ago
config.cfg.sample adding function to switch DNS nameservers + monitoring of current settings; adding a README 2 years ago
fsfe-build.php add php/sh scripts to show build status 1 year ago
fsfe-build.sh add php/sh scripts to show build status 1 year ago
msmtp-handler.sh adding msmtp-queue-handler depending on off/on status; make msmtp-queue paths configurable; reset counter when queue=0 3 years ago
shared-functions.so improve selective status update which makes most preset values unnecessary 2 years ago
status-interaction.sh adding function to switch DNS nameservers + monitoring of current settings; adding a README 2 years ago
status-ip.sh try max. 2 times * 5 secs 1 year ago
status-misc.sh clarify a few strings 1 year ago

README.md

Dynamic Status

These scripts control and monitor several functions of my computer. Most importantly it is possible to switch to a “offline status” which disables several internet-using monitoring functions.

status-ip.sh and status-misc.sh rely on xfce-genmon-plugin to show some status messages on the XFCE task bars.

status-interaction.sh enables users to actively change some values, e.g. the on-/offline status, the used DNS nameserver, and to trigger some actions, e.g. to send mails in an msmtp queue.

I tried to make it as compatible to as many systems as possible but some values are still hard-coded.

DNS nameserver switch

This feature heavily depends on network-manager and its dispatcher feature. In order to use it, put a file in /etc/NetworkManager/dispatcher.d/ and name it 90-custom-resolv.conf for example. Fill it:

#!/bin/bash
#
# Depending on dynamic status, override /etc/resolv.conf

CUSTOM=/tmp/resolv_custom.conf
DEFAULT=/home/user/bin/default-nameserver.sh

if [ ! -e $CUSTOM ]; then  # if file does not exists, use default nameserver script
  bash $DEFAULT
  echo "# 90-custom-resolvconf executed default-nameserver.sh" >> /etc/resolv.conf
  exit 0
fi

SET=$(cat $CUSTOM | head -n1 | awk '{print $NF}')  # first line, last word

if [ "$SET" != "auto" ]; then
  cp -f /etc/resolv.conf /etc/resolv.conf.bak   # backup original resolv config file
  cat $CUSTOM > /etc/resolv.conf  # use custom file, update original one 
else
  echo "# 90-custom-resolvconf didn't change any substantial values here, just added this line." >> /etc/resolv.conf
fi

The file has to be owned by root and be executable in order to function. It will either execute a script that sets default nameserver settings (in my case, it’s localhost since I use a local dnsmasq), or take the values from another file which is created by switching the nameservers with status-interaction.sh.

Nameservers can be configured in config.cfg as value of NS=. It holds following pattern:

set1(ip1,ip2,ip3)|set2(ip4,ip5)

Please remember to put it between quotes.