mirror of
https://github.com/samply/bridgehead.git
synced 2025-12-15 04:57:32 +01:00
refactor: Ensured Usage of Log Function
This should ensure a more consistent script output
This commit is contained in:
@@ -5,12 +5,12 @@ source lib/functions.sh
|
||||
exitIfNotRoot
|
||||
|
||||
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
|
||||
|
||||
@@ -18,7 +18,7 @@ export PROJECT=$1
|
||||
|
||||
checkRequirements
|
||||
|
||||
echo -e "\nInstalling systemd units ..."
|
||||
log "INFO" "Register system units for bridgehead and bridgehead-update"
|
||||
cp -v \
|
||||
lib/systemd/bridgehead\@.service \
|
||||
lib/systemd/bridgehead-update\@.service \
|
||||
@@ -27,13 +27,11 @@ cp -v \
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
echo
|
||||
|
||||
if ! systemctl is-active --quiet bridgehead@"${PROJECT}"; then
|
||||
log "Enabling autostart of bridgehead@${PROJECT}.service"
|
||||
log "INFO" "Enabling autostart of bridgehead@${PROJECT}.service"
|
||||
systemctl enable bridgehead@"${PROJECT}"
|
||||
log "Enabling nightly updates for bridgehead@${PROJECT}.service ..."
|
||||
log "INFO" "Enabling nightly updates for bridgehead@${PROJECT}.service ..."
|
||||
systemctl enable --now bridgehead-update@"${PROJECT}".timer
|
||||
fi
|
||||
|
||||
echo -e "\nDone - now start your bridgehead by running\n\tsystemctl start bridgehead@${PROJECT}.service\nor by rebooting your machine."
|
||||
log "INFO" "\nDone - now start your bridgehead by running\n\tsystemctl start bridgehead@${PROJECT}.service\nor by rebooting your machine."
|
||||
|
||||
Reference in New Issue
Block a user