refactor: Ensured Usage of Log Function

This should ensure a more consistent script output
This commit is contained in:
Torben Brenner
2022-05-17 15:55:25 +02:00
parent 986dd133bd
commit 54897057d9
5 changed files with 19 additions and 22 deletions

View File

@@ -3,12 +3,12 @@
source lib/functions.sh
if [ $# -eq 0 ]; then
log "Please provide a Project as argument"
log "ERROR" "Please provide a Project as argument"
exit 1
fi
if [ $1 != "ccp" ] && [ $1 != "nngm" ] && [ $1 != "gbn" ]; then
log "Please provide a supported project like ccp, gbn or nngm"
log "ERROR" "Please provide a supported project like ccp, gbn or nngm"
exit 1
fi
@@ -16,8 +16,10 @@ export PROJECT=$1
#checkRequirements // not needed when uninstalling
log "Stopping systemd services and removing bridgehead ..."
log "INFO" "Stopping system units and removing bridgehead for ${PROJECT} ..."
systemctl disable --now bridgehead@${PROJECT}.service bridgehead-update@${PROJECT}.timer bridgehead-update@${PROJECT}.service
rm -v /etc/systemd/system/{bridgehead\@.service,bridgehead-update\@.timer,bridgehead-update\@.service}
log "INFO" "Successfully removed bridgehead for ${PROJECT} from your system"