1
0
Fork 0

sb-syncthing: new script

This commit is contained in:
Luca Bilke 2025-02-13 11:15:21 +01:00
parent d91c813527
commit 97c9cef125
Signed by: luca
GPG key ID: F6E11C9BAA7C82F5

View file

@ -0,0 +1,15 @@
#!/bin/sh
. libsb
connections=$(syncthing cli show connections | jq '.connections')
count=$(echo "$connections" | jq 'length')
connected=$(echo "$connections" | jq 'map(select(.connected)) | length')
if [ "$connected" -le 0 ]; then
color=$fgred
else
color=$fggreen
fi
echo "<span ${color}>󰴋 </span>${connected}/${count}"