add root user check for mastercontainer

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
Zoey 2023-05-08 22:59:47 +02:00 committed by GitHub
parent 45ec758e54
commit a9960c8d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,11 @@ case "${1}" in
esac
}
if [ "$(whoami)" != "root" ] || [ "$(id -u)" != "0" ] || [ "$(id -g)" != "0" ]; then
print_red "Container does not run as root. Cannot continue."
exit 1
fi
# Check if socket is available and readable
if ! [ -a "/var/run/docker.sock" ]; then
print_red "Docker socket is not available. Cannot continue."