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 ' +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 '
+
' + date + uptime +echo '+ + +'