Shorten installation by including some installation steps into a shell script

This commit is contained in:
Torben Brenner
2022-05-17 18:04:15 +02:00
committed by Martin Lablans
parent 865870ea91
commit b175c55f5c
8 changed files with 138 additions and 57 deletions

View File

@ -1,7 +1,5 @@
#!/bin/bash -e
source lib/log.sh
detectCompose() {
if [[ "$(docker compose version 2>/dev/null)" == *"Docker Compose version"* ]]; then
COMPOSE="docker compose"
@ -37,11 +35,11 @@ checkOwner(){
printUsage() {
echo "Usage: bridgehead start|stop|update|install|uninstall|enroll PROJECTNAME"
echo "PROJECTNAME should be one of ccp|nngm|bbmri"
echo "PROJECTNAME should be one of ccp|bbmri"
}
checkRequirements() {
if ! lib/prerequisites.sh; then
if ! lib/prerequisites.sh $@; then
log "ERROR" "Validating Prerequisites failed, please fix the error(s) above this line."
fail_and_report 1 "Validating prerequisites failed."
else
@ -120,8 +118,10 @@ fixPermissions() {
source lib/monitoring.sh
report_error() {
log ERROR "$2"
hc_send $1 "$2"
CODE=$1
shift
log ERROR "$@"
hc_send $CODE "$@"
}
fail_and_report() {