Commit 220b0112 authored by Bruno Ribas's avatar Bruno Ribas

Fix 035-last-contact to read LAST+CONTACT from Data

As SDI has created a 999-last-contact, we will now when last contact
arrived and will be able to show any message that is present after this
line. Good thing is that we will now last time machine was ONLINE, and
how was last attempt of SSH from SDI.
Signed-off-by: default avatarBruno Ribas <ribas@c3sl.ufpr.br>
parent 9fb20827
......@@ -2,16 +2,18 @@
function getcolumn()
{
LAST="$(tail -n 1 $DATA)"
if grep -q "^ssh" <<< $LAST; then
printf "<td>$(awk -F':' '{print $NF}' <<< $LAST)</td>"
else
printf "<td>$(cut -d" " -f1,2,3 <<< $LAST)</td>"
LASTCONTACT=$(grep "SDI+LAST+CONTACT" $DATA|tail -1)
LASTLINE=$(tail -n1 $DATA)
if test "$LASTLINE" != "$LASTCONTACT"; then
LASTERROR="$LASTLINE"
fi
LASTCONTACTTIME=$(cut -d' ' -f1,2,3 <<< $LASTCONTACT)
test -n "$LASTCONTACTTIME" && LASTCONTACTTIME="$LASTCONTACTTIME<br/>"
printf "<td>$LASTCONTACTTIME$LASTERROR</td>"
}
function getcolumnname()
{
printf "<td>&Uacute;ltimo Contato</td>"
printf "<td>&Uacute;ltimo Contato/Erro</td>"
}
# vim:tabstop=4:shiftwidth=4:encoding=utf-8:expandtab:filetype=sh
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment