mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-11-15 06:51:12 +00:00
20 lines
438 B
Plaintext
20 lines
438 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
output=""
|
||
|
while IFS="[ .]" read -r connected paused; do
|
||
|
if [ "$paused" == "true" ]; then
|
||
|
output="${output} "
|
||
|
continue
|
||
|
fi
|
||
|
|
||
|
if [ "$connected" == "false" ]; then
|
||
|
output="${output} "
|
||
|
else
|
||
|
output="${output} "
|
||
|
fi
|
||
|
done <<-EOF
|
||
|
$(syncthing cli show connections | jq -r '.connections[] | "\(.connected) \(.paused)"')
|
||
|
EOF
|
||
|
|
||
|
printf "%s" "%{T2}${output%?}%{T-}"
|