Compare commits

...

5 Commits

Author SHA1 Message Date
f9819b3ed5 deprecate wget, use curl instead 2024-02-29 11:48:04 +01:00
bb1a35f645 adapt to KDE/Plasma, get rid of XFCE specifics 2021-01-07 16:40:54 +01:00
23cf4050b1 try max. 2 times * 5 secs 2018-06-23 23:44:04 +02:00
538fd345f9 add php/sh scripts to show build status 2018-05-15 08:30:24 +02:00
01ed78613c clarify a few strings 2018-05-15 08:30:04 +02:00
4 changed files with 45 additions and 19 deletions

8
fsfe-build.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
$command = "/bin/bash fsfe-build.sh https://status.fsfe.org/fsfe.org";
// Execute command and give output
$output = shell_exec($command);
echo "$output";
?>

22
fsfe-build.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
WEB=$1
TMP=.status.tmp
curl -m 10 -s -o $TMP $WEB
STATUS=$(grep "Termination Status" $TMP | perl -pe "s/.*\<dd\>(.+)\<.*/\1/"
)
REV=$(grep "Updating " $TMP | grep -Eo "[[:alnum:]]{7}\.\.[[:alnum:]]{7}")
if [ "$STATUS" == "Success" ]; then
STATUS="fin"
elif [ "$STATUS" == "running..." ]; then
STATUS="run"
fi
if [ "$REV" = "" ]; then
REV="(uncond)"
fi
echo "$STATUS;r$REV"

View File

@@ -3,16 +3,14 @@
CURDIR=$(dirname "$(readlink -f "$0")") CURDIR=$(dirname "$(readlink -f "$0")")
source "$CURDIR"/shared-functions.so source "$CURDIR"/shared-functions.so
IP=$(wget -T 5 -q -O - $IPSERV4) IP=$(curl -m 10 -s -o - $IPSERV4)
EXIT="$?" EXIT="$?"
if [ "$var_conn" == "on" ]; then if [ "$var_conn" == "on" ]; then
if $(echo $IP | grep -qE "$VPNIP"); then if $(echo $IP | grep -qE "$VPNIP"); then
IMAGE="/usr/share/icons/gnome/16x16/apps/gnome-monitor.png"
TEXT="VPN ($IP)" TEXT="VPN ($IP)"
var_ip4="$IP" var_ip4="$IP"
var_vpn="on" var_vpn="on"
echo "<img>$IMAGE</img>"
elif ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then elif ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then
EXIT="fail" EXIT="fail"
TEXT="t/o" TEXT="t/o"
@@ -23,11 +21,11 @@ if [ "$var_conn" == "on" ]; then
var_vpn="off" var_vpn="off"
fi fi
echo "<txt> $TEXT</txt>" echo "$TEXT"
# If request was successful, try IPv6 as well # If request was successful, try IPv6 as well
if [ "$EXIT" != "fail" ]; then if [ "$EXIT" != "fail" ]; then
IP6=$(wget -T 5 -q -O - $IPSERV6) IP6=$(curl -m 10 -s -o - $IPSERV6)
EXIT="$?" EXIT="$?"
if ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then if ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then
TEXT="t/o" TEXT="t/o"
@@ -36,11 +34,11 @@ if [ "$var_conn" == "on" ]; then
TEXT="$IP6" TEXT="$IP6"
var_ip6="$IP6" var_ip6="$IP6"
fi fi
echo "<tool>IPv6: $TEXT</tool>" echo "IPv6: $TEXT"
fi fi
else else
echo "<txt>offline</txt>" echo "offline"
echo "<tool>Offline status is set. Turn on to enable checks</tool>" echo "Offline status is set. Turn on to enable checks"
var_vpn=off var_vpn=off
var_ip4=0.0.0.0 var_ip4=0.0.0.0
var_ip6=::0 var_ip6=::0

View File

@@ -38,7 +38,7 @@ function check_mailqueue {
# SVN STATUS # SVN STATUS
function check_svn { function check_svn {
if isonline; then if isonline; then
STATUS=$(wget -T 5 -q -O - $SVNSTATUS) STATUS=$(curl -m 5 -s -o - $SVNSTATUS)
EXIT="$?" EXIT="$?"
if ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then if ([ "$EXIT" == 4 ] || [ "$EXIT" == 6 ] || [ "$EXIT" == 28 ]); then
SVN="t/o" SVN="t/o"
@@ -47,11 +47,11 @@ function check_svn {
SVN_REV=$(echo $STATUS | cut -d";" -f2) SVN_REV=$(echo $STATUS | cut -d";" -f2)
fi fi
else else
SVN="offline" SVN="off"
SVN_REV="offline" SVN_REV="off"
fi fi
OUT="$OUT;svn=$SVN" OUT="$OUT;web=$SVN"
TOOL="$TOOL;svn=$SVN_REV" TOOL="$TOOL;web=$SVN_REV"
} }
# NAMESERVER STATUS # NAMESERVER STATUS
@@ -75,9 +75,7 @@ OUT=$(echo $OUT | sed -r 's/^;//')
OUT=$(echo $OUT | sed -r 's/;/ \| /g') OUT=$(echo $OUT | sed -r 's/;/ \| /g')
TOOL=$(echo $TOOL | sed -r 's/^;//') TOOL=$(echo $TOOL | sed -r 's/^;//')
TOOL=$(echo $TOOL | sed -r 's/;/ \| /g') TOOL=$(echo $TOOL | sed -r 's/;/ \| /g')
echo "<txt>$OUT</txt>" echo "$OUT"
echo "<tool>$TOOL</tool>" echo "$TOOL"
echo "<img>/usr/share/icons/gnome/16x16/actions/format-justify-fill.png</img>"
echo "<click>xfce4-terminal -x $CURDIR/status-interaction.sh &</click>"
wtmp var_mailqueue_runs # write updated values back to status file wtmp var_mailqueue_runs # write updated values back to status file