schutzbot: add basic schutzbot structure

Simply builds the rpm and installs it.
This commit is contained in:
Sanne Raymaekers 2025-02-18 16:30:12 +01:00
parent 35bb95438b
commit 747b718933
9 changed files with 346 additions and 0 deletions

22
schutzbot/unregister.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# Colorful output.
function greenprint {
echo -e "\033[1;32m[$(date -Isecond)] ${1}\033[0m"
}
function redprint {
echo -e "\033[1;31m[$(date -Isecond)] ${1}\033[0m"
}
if ! hash subscription-manager; then
exit 0
fi
if ! sudo subscription-manager status; then
exit 0
fi
if sudo subscription-manager unregister; then
greenprint "Host unregistered."
exit 0
fi
redprint "Failed to unregister"
exit 1