summaryrefslogtreecommitdiff
path: root/scripts/install/install-image-existing
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-07-29 23:21:02 +0200
committerDaniil Baturin <daniil@baturin.org>2014-07-29 23:21:02 +0200
commit127b7a12dbfabfe33b8d3733648c1bec1fa5d323 (patch)
treed49713b7230a20f4cc59cdc38ad75a05a8237c15 /scripts/install/install-image-existing
parent6ef45f7e83ce58b23442abb4887fe2a9eb50d803 (diff)
downloadvyatta-cfg-system-127b7a12dbfabfe33b8d3733648c1bec1fa5d323.tar.gz
vyatta-cfg-system-127b7a12dbfabfe33b8d3733648c1bec1fa5d323.zip
Replace login name check with effective UID check.
Diffstat (limited to 'scripts/install/install-image-existing')
-rwxr-xr-xscripts/install/install-image-existing5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index 080313bd..ffb5bba3 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -54,8 +54,9 @@ is_amazon_ec2_ami () {
fi
}
-if [ `whoami` != 'root' ] ; then
- failure_exit 'This script must be run with root privileges.'
+if [ $(id -u) != 0 ]; then
+ echo "Image installation requires root privileges!"
+ exit 1
fi
# On image-installed systems, the image name can be found as the