Created
October 30, 2017 07:47
-
-
Save YasushiKobayashi/5d333ebbea935d849ec47e3cf4e5e32f 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 | |
DATE=`date "+%Y%m%d"` | |
INFECTED=`grep Infected /var/log/clamav/scan${DATE}.log` | |
INFECTED_NUMBARE=${INFECTED: -1} | |
echo $INFECTED_NUMBARE | |
if [ $INFECTED_NUMBARE != 0 ]; then | |
WEBHOOKURL="hoge" | |
CHANNEL="hoge" | |
BOTNAME="hoge" | |
FACEICON="hoge" | |
WEBMESSAGE=`cat /var/log/clamav/scan${DATE}.log` | |
echo $WEBMESSAGE | |
curl -s -S -X POST --data-urlencode "payload={ \ | |
\"channel\": \"${CHANNEL}\", \ | |
\"username\": \"${BOTNAME}\", \ | |
\"icon_url\": \"${FACEICON}\", \ | |
\"text\": \"${WEBMESSAGE}\" \ | |
}" ${WEBHOOKURL} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment