From 46ad2de5d9a819523efa2998f82f96660c684847 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 28 Sep 2011 18:29:50 -0700 Subject: [PATCH] build_lxc.sh needs to be root to run --- build_lxc.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build_lxc.sh b/build_lxc.sh index 471b7dc..191c493 100755 --- a/build_lxc.sh +++ b/build_lxc.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash +# Sanity check +if [ "$EUID" -ne "0" ]; then + echo "This script must be run with root privileges." + exit 1 +fi + +# Warn users who aren't on natty +if ! grep -q natty /etc/lsb-release; then + echo "WARNING: this script has only been tested on natty" +fi + # Source params source ./stackrc @@ -23,10 +34,6 @@ STACKSH_PARAMS=${STACKSH_PARAMS:-} # Option to use the version of devstack on which we are currently working USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1} -# Warn users who aren't on natty -if ! grep -q natty /etc/lsb-release; then - echo "WARNING: this script has only been tested on natty" -fi # Install deps apt-get install -y lxc debootstrap