|
|
|
@ -7,14 +7,15 @@ SYNC_IN_PROGRESS=$(printf '%s%s' '%{F#FF0}' $(echo -e '\Uf1216')) # yellow
|
|
|
|
|
SYNC_FAILED=$(printf '%s%s' '%{F#F00}' $(echo -e '\Uf0b98')) # red
|
|
|
|
|
|
|
|
|
|
if ! command -v seaf-cli &>/dev/null ; then
|
|
|
|
|
echo "Seafile not downloaded to device!">&2
|
|
|
|
|
echo "depends on seaf-cli">&2
|
|
|
|
|
echo "$SYNC_FAILED"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# getting folder status and trimming headers
|
|
|
|
|
SEAFILE_STATUS=$(seaf-cli status | tail -n +2)
|
|
|
|
|
SEAFILE_STATUS=$(seaf-cli status 2>/dev/null | tail -n +2)
|
|
|
|
|
ERRORS=$(echo "$SEAFILE_STATUS" | grep "error")
|
|
|
|
|
|
|
|
|
|
if [[ -n "$ERRORS" ]] ; then
|
|
|
|
|
# some directories have errors
|
|
|
|
|
echo "Error: Failed to sync">&2
|
|
|
|
|