From aa858886e7301b08198827606c01902ead2929af Mon Sep 17 00:00:00 2001 From: Stanislav Vitko Date: Tue, 6 Aug 2013 16:31:15 -0700 Subject: [PATCH] check for selinux status before turning off --- gitlab-install-el5.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gitlab-install-el5.sh b/gitlab-install-el5.sh index cfdfd11..ea32e9f 100755 --- a/gitlab-install-el5.sh +++ b/gitlab-install-el5.sh @@ -54,12 +54,18 @@ echo "### Check if we are root" echo "### Configure SELinux" -# Disable SELinux -sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config +if [[ $? -eq 0 ]] +then + echo "SELinux disabled" +else + echo "SELinux enabled" -# Turn off SELinux in this session -setenforce 0 + # Disable SELinux + sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config + # Turn off SELinux in this session + setenforce 0 +fi echo "### Installing packages"