uptime 431 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. # grugly@sdf
  3. source '../say.sh'
  4. ch="$2"
  5. req="$3"
  6. if [[ $req =~ 'faeroes'|'iceland'|'norge'|'ol'|'sdf'|'vpn'|'vps'|'vps2'|'vps3'|'wm' ]]
  7. then
  8. msg="$(
  9. lynx -connect_timeout=5 -dump http://sdf.org/?status |
  10. grep -m 1 "$req" |
  11. sed -e 's/^[ \t]*//' | tr -s ' '
  12. )"
  13. else
  14. msg='Valid hosts are faeroes, iceland, norge, ol, sdf, vpn, vps, vps2, vps3 and wm.'
  15. fi
  16. say "$ch" "$msg"