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.
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:
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: