- more tidying up

- setting up distribution plugin
- using more variables for mod config
This commit is contained in:
Adam 2021-12-02 00:54:15 +01:00
parent afbfeda616
commit 7091f7648d
34 changed files with 293 additions and 169 deletions

View file

@ -0,0 +1,24 @@
#!/usr/bin/bash
# Pipe Docker logs from a Factorio server to a Kafka topic
echo "Piping logs from $FACTORIO_SERVER_CONTAINER_NAME to $KAFKA_HOST"
# generate some distinctive key for messages from this server
SERVER_HASH=openssl dgst -sha3-512 "$CONFIG/server-settings.json"
trap endProcess SIGINT
endProcess() {
echo "Exiting Factorio Events Kafka Pipe"
exit
}
while :; do
sed -n -e 's/^FactorioEvent: //p' |
kafkacat -F "$KCAT_PROP_FILE"
echo "Error - retrying in 10 seconds"
sleep 10
done