2022-01-10 16:31:48 +01:00
|
|
|
#!/bin/bash -e
|
2021-12-22 13:18:41 +01:00
|
|
|
|
2022-01-10 16:31:48 +01:00
|
|
|
source lib/functions.sh
|
2021-12-22 13:18:41 +01:00
|
|
|
|
2022-05-04 13:50:33 +02:00
|
|
|
if [ $# -eq 0 ]; then
|
2022-05-17 15:55:25 +02:00
|
|
|
log "ERROR" "Please provide a Project as argument"
|
2022-05-04 13:50:33 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-10-25 11:45:01 +02:00
|
|
|
if [ $1 != "ccp" ] && [ $1 != "nngm" ] && [ $1 != "bbmri" ]; then
|
|
|
|
log "ERROR" "Please provide a supported project like ccp, bbmri or nngm"
|
2022-05-04 13:50:33 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-05-11 10:30:18 +02:00
|
|
|
export PROJECT=$1
|
2022-05-04 13:50:33 +02:00
|
|
|
|
2022-05-09 15:13:38 +02:00
|
|
|
#checkRequirements // not needed when uninstalling
|
2022-05-04 13:50:33 +02:00
|
|
|
|
2022-09-30 15:25:09 +02:00
|
|
|
log INFO "Removing bridgehead sudoers permissions."
|
|
|
|
|
|
|
|
rm -vf /etc/sudoers.d/bridgehead-${PROJECT}
|
|
|
|
|
2022-05-17 15:55:25 +02:00
|
|
|
log "INFO" "Stopping system units and removing bridgehead for ${PROJECT} ..."
|
2021-12-23 14:54:35 +01:00
|
|
|
|
2022-05-11 10:30:18 +02:00
|
|
|
systemctl disable --now bridgehead@${PROJECT}.service bridgehead-update@${PROJECT}.timer bridgehead-update@${PROJECT}.service
|
2022-01-10 16:36:54 +01:00
|
|
|
|
|
|
|
rm -v /etc/systemd/system/{bridgehead\@.service,bridgehead-update\@.timer,bridgehead-update\@.service}
|
2022-05-17 15:55:25 +02:00
|
|
|
|
|
|
|
log "INFO" "Successfully removed bridgehead for ${PROJECT} from your system"
|