Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
seafile-sync
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
seafile-sync
Commits
717e05fd
Verified
Commit
717e05fd
authored
5 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Only update output if it has actually changed
parent
cb209a5e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker-entrypoint.sh
+11
-2
11 additions, 2 deletions
docker-entrypoint.sh
with
11 additions
and
2 deletions
docker-entrypoint.sh
+
11
−
2
View file @
717e05fd
...
@@ -11,21 +11,30 @@ sleep 5
...
@@ -11,21 +11,30 @@ sleep 5
if
[
-z
"
$OTP_TOKEN
"
]
;
then
if
[
-z
"
$OTP_TOKEN
"
]
;
then
echo
"syncing library"
echo
"syncing library"
date
seaf-cli
sync
-l
"
$LIBRARY
"
-s
"
$SERVER
"
-d
"/sync"
-u
"
$EMAIL
"
-p
"
$PASSWORD
"
seaf-cli
sync
-l
"
$LIBRARY
"
-s
"
$SERVER
"
-d
"/sync"
-u
"
$EMAIL
"
-p
"
$PASSWORD
"
else
else
echo
"syncing library with OTP"
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
"
)
seaf-cli
sync
-l
"
$LIBRARY
"
-s
"
$SERVER
"
-d
"/sync"
-u
"
$EMAIL
"
-p
"
$PASSWORD
"
--tfa
$(
oathtool
--totp
-b
"
$OTP_TOKEN
"
)
fi
fi
maxretry
=
4
maxretry
=
4
retry
=
0
retry
=
0
lastoutput
=
""
output
=
""
while
[
"
$retry
"
-le
"
$maxretry
"
]
;
do
while
[
"
$retry
"
-le
"
$maxretry
"
]
;
do
ps aux |
grep
seafile |
grep
-v
grep
>
/dev/null 2> /dev/null
||
{
ps aux |
grep
seafile |
grep
-v
grep
>
/dev/null 2> /dev/null
||
{
retry
=
$(
expr
$retry
+ 1
)
;
retry
=
$(
expr
$retry
+ 1
)
;
}
}
output
=
$(
seaf-cli status
)
if
[[
"
$output
"
!=
"
$lastoutput
"
]]
;
then
date
date
seaf-cli status
echo
"
$output
"
lastoutput
=
"
$output
"
fi
sleep
5
sleep
5
done
done
echo
"Seafile not running"
echo
"Seafile not running"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment