diff --git a/syncthing.sh b/syncthing.sh index b64c8f0..bb60814 100755 --- a/syncthing.sh +++ b/syncthing.sh @@ -19,7 +19,7 @@ ST_CONTAINER="" get_apikey() { ST_CONTAINER=$(docker ps --format '{{.Names}}' | grep -i syncthing | head -1 || true) [ -n "$ST_CONTAINER" ] || die "No running Syncthing container found." - APIKEY=$(docker exec "$ST_CONTAINER" python3 -c "import xml.etree.ElementTree as ET; print(ET.parse('/var/syncthing/config/config.xml').find('.//apikey').text)" 2>/dev/null || true) + APIKEY=$(docker exec "$ST_CONTAINER" cat /var/syncthing/config/config.xml 2>/dev/null | grep -o '[^<]*' | sed 's/<[^>]*>//g' || true) [ -n "$APIKEY" ] || die "Could not read Syncthing API key from container '$ST_CONTAINER'." }