Skip to content

Instantly share code, notes, and snippets.

@gernest
Created August 22, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gernest/759bf7c9787636acf08d971f17f73b38 to your computer and use it in GitHub Desktop.
Save gernest/759bf7c9787636acf08d971f17f73b38 to your computer and use it in GitHub Desktop.
#!/bin/sh
FILENAME=/home/fri/fessbox/backend-node/log/debug.log
SUFFIX=`date '+%Y.%m.%d-%H'`
if [ -s $FILENAME-$SUFFIX ]
then
sms=`/usr/bin/grep -cF "sms_in" $FILENAME-$SUFFIX`
calls=`/usr/bin/grep -cF "from ring to master" $FILENAME-$SUFFIX`
echo "{\"incoming_sms\":$sms,\"incoming_calls\":$calls}"
else echo "{\"incoming_sms\":0,\"incoming_calls\":0}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment