#!/bin/sh echo 'Content-Type: text/html; charset=UTF-8' echo # stat -c %Y IP # date +%s cat <<_END1_ __HTML5__ __TITLE__ __NAVIGATION__
__H1__

It's not always up or the IP address might be different, so I'll (automatically) link to the right place below. It's supposed to be on thinkpad.oskog97.com but... :-/

_END1_ stale_time=$(($(date +%s) - $(stat -c %Y IP))) if [ $stale_time -lt 600 ]; then IP=$(cat IP) A=$(host thinkpad.oskog97.com | cut -d' ' -f4) if [ "$A" = "$IP" ]; then DNS_status="The thinkpad subdomain's A-record matches the IP address" link="http://thinkpad.oskog97.com/" else DNS_status="The thinkpad subdomain needs to be updated!" link="http://$IP/" fi cat <<_END2_

It's up!

IP: ${IP}

${DNS_status}

Visit its website

_END2_ else link="https://web.archive.org/web/http://thinkpad.oskog97.com/" echo "

Visit its website on archive.org

" fi cat <<_END3_
__FOOTER__ _END3_