Quote:
Originally Posted by loki_himself
is it possible for an amxx plugin to listen to the console output, for example for those strings?
|
I don't think you can tho, it only reads those that are you've used on `register_srvcmd`. You can use `tail` to read X last lines and loop over them to check if line starts with `WARNING: datagram overflowed for` or `SZ_GetSpace: overflow on`.
Here's an example:
Code:
#!/bin/bash
$webhook="discord-webhook"
send_discord_message () {
curl -X POST -H "Content-Type: application/json" -d "{\"content\":\"$1\"}" $webhook
}
while [ true ]; do
tail -n 10 /home/user/server/screenlog.0 | while read line; do
if [[ $line = "Segmentation faul"* ]]; then
send_discord_message "Server died: ${line}"
fi
sleep 10
done
__________________