From e5a04e8d3878eaec3b2c886225c3642da351d077 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 21 Jan 2019 13:33:19 +0100 Subject: [PATCH] Check for sudo access of root user in cloudron-setup --- scripts/cloudron-setup | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index ff53a0075..8d164e0a8 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -89,6 +89,17 @@ if [[ "${ubuntu_version}" != "16.04" && "${ubuntu_version}" != "18.04" ]]; then exit 1 fi +# check if this user has sudo access required for cloudron further on +# some setups like scaleway have a root user who is not allowed to use sudo +if [[ ! `sudo /bin/true` ]]; then + echo "Cloudron requires root to use sudo." + echo "Ensure /etc/sudoers contains the following line:" + echo "" + echo "root ALL=(ALL:ALL) ALL" + echo "" + exit 1; +fi + # Can only write after we have confirmed script has root access echo "Running cloudron-setup with args : $@" > "${LOG_FILE}"