Skip to content

Commit 43138d8

Browse files
committed
Do not fail if SLEEP_TIME is missing
1 parent bb60a4c commit 43138d8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

shepherd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,24 @@ update_services() {
2424
}
2525

2626
main() {
27-
local blacklist supports_detach_option=false
27+
local blacklist sleep_time supports_detach_option
2828
blacklist="${BLACKLIST_SERVICES:-}"
29+
sleep_time="${SLEEP_TIME:-5m}"
2930

31+
supports_detach_option=false
3032
if [[ "$(server_version)" > "17.05" ]]; then
3133
supports_detach_option=true
3234
echo "Enabling synchronous service updates"
35+
else
36+
supports_detach_option=false
3337
fi
3438

3539
[[ "$blacklist" != "" ]] && echo "Excluding services: $blacklist"
3640

3741
while true; do
3842
update_services "$blacklist" "$supports_detach_option"
39-
echo "Sleeping $SLEEP_TIME before next update"
40-
sleep "$SLEEP_TIME"
43+
echo "Sleeping $sleep_time before next update"
44+
sleep "$sleep_time"
4145
done
4246
}
4347

0 commit comments

Comments
 (0)