diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-12-18 17:41:57 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-12-18 17:41:57 -0500 |
commit | f96154a26c948be8a9da8eb7b7662b99a5930afd (patch) | |
tree | 9600ee265be81b24bdab49839a77e8725df53d5d /cobbler.spec | |
parent | aefc7252b23f019338e99f1c9e2530d2a7623d01 (diff) | |
download | cobbler-f96154a26c948be8a9da8eb7b7662b99a5930afd.tar.gz cobbler-f96154a26c948be8a9da8eb7b7662b99a5930afd.tar.xz cobbler-f96154a26c948be8a9da8eb7b7662b99a5930afd.zip |
selinux updates to specfile
Diffstat (limited to 'cobbler.spec')
-rw-r--r-- | cobbler.spec | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cobbler.spec b/cobbler.spec index 0fb137a7..fe67d740 100644 --- a/cobbler.spec +++ b/cobbler.spec @@ -78,9 +78,13 @@ PREFIX="--prefix=/usr" %post # add selinux rules if [ -x /usr/sbin/semanage ]; then - /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*" - /usr/sbin/semanage fcontext -a -t public_content_t "/var/lib/tftpboot/images/.*" - /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/images/.*" + /usr/sbin/selinuxenabled + if [ "$?" -eq "0" ]; then + echo "selinux is enabled" + /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*" >/dev/null &2>1 && /bin/true + /usr/sbin/semanage fcontext -a -t public_content_t "/var/lib/tftpboot/images/.*" >/dev/null &2>1 && /bin/true + /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/images/.*" >/dev/null &2>1 && /bin/true + fi fi # backup config @@ -129,9 +133,12 @@ if [ "$1" -ge "1" ]; then fi # remove selinux rules if [ -x /usr/sbin/semanage ]; then - /usr/sbin/semanage fcontext -d "/var/www/cobbler/images/.*" - /usr/sbin/semanage fcontext -d "/var/lib/tftpboot/images/.*" - /usr/sbin/semanage fcontext -d "/tftpboot/images/.*" + /usr/sbin/selinuxenabled + if [ "$?" -eq "0" ]; then + /usr/sbin/semanage fcontext -d "/var/www/cobbler/images/.*" 1>/dev/null 2>&1 && /bin/true + /usr/sbin/semanage fcontext -d "/var/lib/tftpboot/images/.*" 1>/dev/null 2>&1 && /bin/true + /usr/sbin/semanage fcontext -d "/tftpboot/images/.*" 1>/dev/null 2>&1 && /bin/true + fi fi |