Compare commits
5 Commits
5628382a5d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f9819b3ed5 | |||
|
bb1a35f645
|
|||
|
23cf4050b1
|
|||
|
538fd345f9
|
|||
|
01ed78613c
|
8
fsfe-build.php
Normal file
8
fsfe-build.php
Normal 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
22
fsfe-build.sh
Executable 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"
|
||||||
14
status-ip.sh
14
status-ip.sh
@@ -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
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ TOOL="$TOOL;conn=$var_conn"
|
|||||||
function check_mailqueue {
|
function check_mailqueue {
|
||||||
QUEUE=$($MSMTP_LIST | grep -o "^From: " | wc -l)
|
QUEUE=$($MSMTP_LIST | grep -o "^From: " | wc -l)
|
||||||
OUT="$OUT;mq=$QUEUE"
|
OUT="$OUT;mq=$QUEUE"
|
||||||
|
|
||||||
# If $QUEUE > 0 and >10 runs, show notification
|
# If $QUEUE > 0 and >10 runs, show notification
|
||||||
if [ "$QUEUE" -gt 0 ]; then
|
if [ "$QUEUE" -gt 0 ]; then
|
||||||
var_mailqueue_runs=$(($var_mailqueue_runs + 1))
|
var_mailqueue_runs=$(($var_mailqueue_runs + 1))
|
||||||
@@ -32,13 +32,13 @@ function check_mailqueue {
|
|||||||
if [ "$QUEUE" -gt 0 ] && [ "$var_mailqueue_runs" -gt 9 ]; then
|
if [ "$QUEUE" -gt 0 ] && [ "$var_mailqueue_runs" -gt 9 ]; then
|
||||||
notify-send "There are mails in the mailqueue. Remember sending them manually or switch online status."
|
notify-send "There are mails in the mailqueue. Remember sending them manually or switch online status."
|
||||||
var_mailqueue_runs=0 # reset counter
|
var_mailqueue_runs=0 # reset counter
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user