Skip to content

Instantly share code, notes, and snippets.

@s1037989
Last active September 3, 2021 10:15
Show Gist options
  • Select an option

  • Save s1037989/e9f79ce8740c2349d832b6c0d1369328 to your computer and use it in GitHub Desktop.

Select an option

Save s1037989/e9f79ce8740c2349d832b6c0d1369328 to your computer and use it in GitHub Desktop.
moshel
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