diff --git a/scripts/dockerimages/scripts/rancheros-install b/scripts/dockerimages/scripts/rancheros-install index 7f005fb3..2bb2b74a 100755 --- a/scripts/dockerimages/scripts/rancheros-install +++ b/scripts/dockerimages/scripts/rancheros-install @@ -23,6 +23,11 @@ EOF PARTITION_FLAG="false" INSTALL_CONTAINER_IMAGE="rancher/os" +if [ "$(whoami)" != "root" ]; then + echo "Please run as root." 1>&2 + exit 1 +fi + if [ -x /usr/bin/rancherctl ]; then INSTALL_CONTAINER_IMAGE="$(rancherctl config get upgrade.image)" fi @@ -46,11 +51,6 @@ do esac done -if [ "$(whoami)" != "root" ]; then - echo "Please run as root." 1>&2 - exit 1 -fi - if [[ -z "${INSTALL_TYPE}" ]]; then echo "No install type specified...defaulting to generic" INSTALL_TYPE="generic"