From caa01683afbf2a8728e1dc67f04417adbcca5f51 Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Sun, 5 Apr 2020 12:19:00 +0200 Subject: [PATCH] Fix bash script --- docker-entrypoint.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index ae1c8eb..611473d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,14 +1,21 @@ #!/usr/bin/env bash set -Eeo pipefail +trap "exit" INT + mkdir /seafile-data seaf-cli init -d /seafile-data +seaf-cli start + +sleep 5 + if [ -z "$OTP_TOKEN" ]; then + echo "syncing library" seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD" else + echo "syncing library with OTP" seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD" --tfa $(oathtool --totp -b "$OTP_TOKEN") fi -seaf-cli start maxretry=4 retry=0 @@ -17,6 +24,7 @@ while [ "$retry" -le "$maxretry" ]; do ps aux | grep seafile | grep -v grep > /dev/null 2> /dev/null || { retry=$(expr $retry + 1); } + seaf-cli status sleep 5 done echo "Seafile not running" -- GitLab