Exit cleanly if run as a non-root user
Exits with a message if the efficitive-uid (EUID) is not 0 Change-Id: If36a9ede5f8bfc763d86870e6f630bafee605476 Reviewed-on: https://review.openstack.org/19453 Reviewed-by: Dan Prince <dprince@redhat.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: Monty Taylor <mordred@inaugust.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
27024edcbc
commit
2c6a5f3e8e
@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat > /etc/apt/preferences.d/00-puppet.pref <<EOF
|
||||
Package: puppet puppet-common puppetmaster puppetmaster-common
|
||||
Pin: version 2.7*
|
||||
|
Loading…
x
Reference in New Issue
Block a user