Merge pull request #154 from rhatdan/selinux
Make sure selinuxenabled exists before executing it
This commit is contained in:
commit
63614ff690
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ RUNC_PATH=$(command -v runc || true)
|
||||||
RUNC_BINARY=${RUNC_PATH:-/usr/local/sbin/runc}
|
RUNC_BINARY=${RUNC_PATH:-/usr/local/sbin/runc}
|
||||||
|
|
||||||
TESTDIR=$(mktemp -d)
|
TESTDIR=$(mktemp -d)
|
||||||
if selinuxenabled; then
|
if [ -e /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
|
||||||
. /etc/selinux/config
|
. /etc/selinux/config
|
||||||
filelabel=$(awk -F'"' '/^file.*=.*/ {print $2}' /etc/selinux/${SELINUXTYPE}/contexts/lxc_contexts)
|
filelabel=$(awk -F'"' '/^file.*=.*/ {print $2}' /etc/selinux/${SELINUXTYPE}/contexts/lxc_contexts)
|
||||||
chcon -R ${filelabel} $TESTDIR
|
chcon -R ${filelabel} $TESTDIR
|
||||||
|
|
Loading…
Reference in a new issue