-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eric Nemchik <[email protected]>
- Loading branch information
Showing
4 changed files
with
30 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
IFS=$'\n\t' | ||
|
||
enable_docker_service() { | ||
DOCKER_SERVICE_ENABLE="" | ||
DOCKER_SERVICE_START="" | ||
if [[ -n "$(command -v systemctl)" ]]; then | ||
info "Systemd detected." | ||
DOCKER_SERVICE_ENABLE="systemctl enable docker" | ||
DOCKER_SERVICE_START="systemctl start docker" | ||
elif [[ -n "$(command -v rc-update)" ]]; then | ||
info "OpenRC detected." | ||
DOCKER_SERVICE_ENABLE="rc-update add docker boot" | ||
DOCKER_SERVICE_START="service docker start" | ||
fi | ||
if [[ -n "${DOCKER_SERVICE_ENABLE}" ]]; then | ||
info "Enabling docker service." | ||
sudo "${DOCKER_SERVICE_ENABLE}" > /dev/null 2>&1 || fatal "Failed to enable docker service.\nFailing command: ${F[C]}${DOCKER_SERVICE_ENABLE}" | ||
info "Starting docker service." | ||
sudo "${DOCKER_SERVICE_START}" > /dev/null 2>&1 || fatal "Failed to start docker service.\nFailing command: ${F[C]}${DOCKER_SERVICE_START}" | ||
fi | ||
} | ||
|
||
test_enable_docker_service() { | ||
run_script 'require_docker' | ||
run_script 'enable_docker_service' | ||
} |
This file was deleted.
Oops, something went wrong.
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