Last active
September 3, 2021 10:15
-
-
Save s1037989/e9f79ce8740c2349d832b6c0d1369328 to your computer and use it in GitHub Desktop.
moshel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CENTRAL="http://localhost:3000" | |
| PushCentral $MYNAME | |
| Summary () { | |
| for U in $WWWDIR/snippet.*.html; do | |
| cat $U >> $WWWDIR/summary.html | |
| RESLT=$? | |
| if [ $RESLT -gt 0 ]; then | |
| echo "$U is unreachable" >> /tmp/tmp.$$.moshel_alert.tmp | |
| fi | |
| echo "<p>" >> $WWWDIR/summary.html | |
| done | |
| } | |
| PushCentral () { | |
| for U in $@; do | |
| curl -F "summary=@$WWWDIR/snippet.html" $CENTRAL/$U | |
| RESLT=$? | |
| if [ $RESLT -gt 0 ]; then | |
| echo "$U is unreachable" >> /tmp/tmp.$$.moshel_alert.tmp | |
| fi | |
| done | |
| } | |
| $ perl -Mojo -E 'a(["POST"] => "/:server" => sub { warn my $s = $_->param("server"); $_->param("summary")->move_to($s); $_->render(text => "", status => 200); })->start' daemon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment