Created
August 22, 2016 08:29
-
-
Save gernest/759bf7c9787636acf08d971f17f73b38 to your computer and use it in GitHub Desktop.
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
#!/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