Verify setenforce is executable

Some images/distros do not install/use selinux. This small change will
verify that `setenforce` is executable and in the path before attempting
to run the command. This prevents the script from erroring and causing a
failed `cloud-init` run.

Change-Id: I42f802c7994b8d907f0cc4e3b1a38e6fd89dac0c
This commit is contained in:
BK Box 2014-02-04 10:16:58 -06:00
parent c02b8e8c02
commit 265467f5cd
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
setenforce 0
command -v setenforce >/dev/null 2>&1 && setenforce 0
useradd -m @INSTANCE_USER@
echo -e '@INSTANCE_USER@\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers