smart log script

This commit is contained in:
Sebastian
2024-08-28 10:40:46 +02:00
parent 3af587dd70
commit c6a90a3a43

8
logs.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
if [ -z "$1" ] || [ ! -f "/root/rpc/$1.yml" ]; then
echo "Error: Either no argument provided or /root/rpc/$1.yml does not exist."
exit 1
fi
docker compose logs -f $(cat /root/rpc/$1.yml | yaml2json - | jq '.services' | jq -r 'keys[]' | tr '\n' ' ')