-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jitter to auto-update, as well as simple CLI tool
- Loading branch information
1 parent
9d1c1e0
commit 9a77a8a
Showing
4 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
echo "Enable/Disable autoupdate for your node" | ||
echo "" | ||
echo "To enable autoupdate use: set-autoupdate true" | ||
echo "To disable autoupdate use: set-autoupdate false" | ||
echo "" | ||
|
||
if [[ -z $1 ]]; then | ||
echo "Please provide a value for autoupdate" | ||
exit 1 | ||
fi | ||
|
||
if [[ $1 != "true" && $1 != "false" ]]; then | ||
echo "Invalid value for autoupdate. Please use 'true' or 'false'." | ||
exit 1 | ||
fi | ||
|
||
VOINETWORK_PROFILE=$(cat "${HOME}/voi/profile") | ||
|
||
if [[ ${VOINETWORK_PROFILE} == "relay" ]]; then | ||
docker_filename="${HOME}/voi/docker/relay.yml" | ||
else | ||
docker_filename="${HOME}/voi/docker/compose.yml" | ||
fi | ||
|
||
echo "Setting autoupdate to $1 in ${docker_filename}" | ||
sed -i -E "s|(swarm.cronjob.enable=).*|\1$1|" "${docker_filename}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters