Move to functions.sh
This commit is contained in:
parent
5755baaf00
commit
2aef5f29c3
|
@ -58,6 +58,8 @@ if [ -f "$PROJECT/docker-compose.override.yml" ]; then
|
|||
OVERRIDE+=" -f ./$PROJECT/docker-compose.override.yml"
|
||||
fi
|
||||
|
||||
detectCompose
|
||||
|
||||
case "$ACTION" in
|
||||
start)
|
||||
hc_send log "Bridgehead $PROJECT startup: Checking requirements ..."
|
||||
|
|
|
@ -2,6 +2,15 @@
|
|||
|
||||
source lib/log.sh
|
||||
|
||||
detectCompose() {
|
||||
if [[ "$(docker compose version 2>/dev/null)" == *"Docker Compose version"* ]]; then
|
||||
COMPOSE="docker compose"
|
||||
else
|
||||
COMPOSE="docker-compose"
|
||||
# This is intended to fail on startup in the next prereq check.
|
||||
fi
|
||||
}
|
||||
|
||||
exitIfNotRoot() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
log "ERROR" "Please run as root"
|
||||
|
|
|
@ -10,12 +10,6 @@ fi
|
|||
checkOwner . bridgehead || exit 1
|
||||
checkOwner /etc/bridgehead bridgehead || exit 1
|
||||
|
||||
if [[ "$(docker compose version 2>/dev/null)" == *"Docker Compose version"* ]]; then
|
||||
COMPOSE="docker compose"
|
||||
else
|
||||
COMPOSE="docker-compose"
|
||||
fi
|
||||
|
||||
## Check if user is a su
|
||||
log INFO "Checking if all prerequisites are met ..."
|
||||
prerequisites="git docker $COMPOSE"
|
||||
|
|
Loading…
Reference in New Issue