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.
 
 

47 lines
988 B

#!/bin/bash
CURDIR=$(dirname "$(readlink -f "$0")")
source "$CURDIR"/shared-functions.so
IP=$(wget -T 5 -t 2 -q -O - $IPSERV4)
EXIT="$?"
if [ "$var_conn" == "on" ]; then
if $(echo $IP | grep -qE "$VPNIP"); then
TEXT="VPN ($IP)"
var_ip4="$IP"
var_vpn="on"
elif ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then
EXIT="fail"
TEXT="t/o"
var_ip4="0.0.0.0"
else
TEXT="$IP"
var_ip4="$IP"
var_vpn="off"
fi
echo "$TEXT"
# If request was successful, try IPv6 as well
if [ "$EXIT" != "fail" ]; then
IP6=$(wget -T 5 -t 2 -q -O - $IPSERV6)
EXIT="$?"
if ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then
TEXT="t/o"
var_ip6="::0"
else
TEXT="$IP6"
var_ip6="$IP6"
fi
echo "IPv6: $TEXT"
fi
else
echo "offline"
echo "Offline status is set. Turn on to enable checks"
var_vpn=off
var_ip4=0.0.0.0
var_ip6=::0
fi
wtmp var_ip4 var_ip6 var_vpn # Write changes back