diff --git a/etc/services b/etc/services new file mode 100644 index 0000000..e69de29 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..08ab018 --- /dev/null +++ b/install.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +install -D ./libexec/status /usr/local/libexec/yonderly.org/status +install -D ./libexec/services /usr/local/libexec/yonderly.org/services + +install -D -b -m 644 ./etc/services /etc/yonderly.org/services diff --git a/libexec/services b/libexec/services new file mode 100755 index 0000000..bafe9ce --- /dev/null +++ b/libexec/services @@ -0,0 +1,32 @@ +#!/bin/sh +# prints static page of HTTP responses of given URLs. +# ethan@yonderly.org, 0BSD. + +URLS_FILE="/etc/yonderly.org/services" # a new-line seperated list of URLs. +CSS_HREF="/static/main.css" + +date=$(date) + +echo ' + + + + + + ' +echo ' +

services

+

the following is the statuses of services provided by yonderly.org as of '$date'. feel free to contact us for more information about an extended outage.

+

' + for service in $(cat $URLS_FILE) + do + response=`/usr/local/bin/curl -Z --write-out "%{http_code}\n" --silent --output /dev/null "$service"` + echo " " + printf "$service: " + [[ "$response" == "200" ]] && printf "" || printf "" + printf "$response
" + done + echo ' +

+ +' diff --git a/libexec/status b/libexec/status new file mode 100755 index 0000000..bc64da8 --- /dev/null +++ b/libexec/status @@ -0,0 +1,23 @@ +#!/bin/sh +# prints static page with some system information. +# ethan@yonderly.org, 0BSD. + +CSS_HREF="/static/main.css" + +echo ' + + + + + + ' +echo ' + +

system status

+
'
+		date
+		uptime
+echo '
+ + +'