Skip to content
Snippets Groups Projects
Verified Commit 717e05fd authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Only update output if it has actually changed

parent cb209a5e
No related branches found
No related tags found
No related merge requests found
......@@ -11,21 +11,30 @@ sleep 5
if [ -z "$OTP_TOKEN" ]; then
echo "syncing library"
date
seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD"
else
echo "syncing library with OTP"
date
seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD" --tfa $(oathtool --totp -b "$OTP_TOKEN")
fi
maxretry=4
retry=0
lastoutput=""
output=""
while [ "$retry" -le "$maxretry" ]; do
ps aux | grep seafile | grep -v grep > /dev/null 2> /dev/null || {
retry=$(expr $retry + 1);
}
output=$(seaf-cli status)
if [[ "$output" != "$lastoutput" ]]; then
date
seaf-cli status
echo "$output"
lastoutput="$output"
fi
sleep 5
done
echo "Seafile not running"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment