check nest.pijul.com resources and notify by PicoLisp
  
#!/usr/bin/env pil
(setq DB "~/.pil/nestping")
(unless (info DB)
(rc DB 'ssh T 'https T 'crates T) )
(de last-vers ()
(let V NIL
(in '(curl "-s" "https://raw.githubusercontent.com/rust-lang/crates.io-index/master/pi/ju/pijul")
(until (eof)
(from "vers\":\"")
(setq V (read))
(line) ) )
V ) )
(de ssh ()
(let
(Now (bool (connect "ssh.pijul.com" 22))
Was (rc DB 'ssh) )
(if2 Was Now
NIL
(mail "localhost" 25 "[email protected]" (quote "[email protected]" "[email protected]") "ssh down")
(mail "localhost" 25 "[email protected]" (quote "[email protected]" "[email protected]") "ssh up") )
(rc DB 'ssh Now)
(bye) ) )
(de https ()
(let
(Now
(call
'bash
'-c
"http --check-status https://nest.pijul.com/tankf33der/nestping:main/SANLDXIK76PNA.BEAAA > /dev/null")
Was (rc DB 'https))
(if2 Was Now
NIL
(mail "localhost" 25 "[email protected]" (quote "[email protected]" "[email protected]") "https down")
(mail "localhost" 25 "[email protected]" (quote "[email protected]" "[email protected]") "https up") )
(rc DB 'https Now)
(bye) ) )
(de crates ()
(let (Now (last-vers) Was (rc DB 'crates))
(unless (= Now Was)
(mail "localhost" 25 "[email protected]" "[email protected]" (pack "crates changed: " Now))
(rc DB 'crates Now) )
(bye) ) )