File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,13 @@ if [ ! -e '/usr/lib/apt/methods/https' ]; then
283283 check_result $? " Can't install apt-transport-https"
284284fi
285285
286+ # Check if apparmor is installed
287+ if [ $( dpkg-query -W -f=' ${Status}' apparmor 2> /dev/null | grep -c " ok installed" ) -eq 0 ]; then
288+ apparmor=' no'
289+ else
290+ apparmor=' yes'
291+ fi
292+
286293# Checking repository availability
287294wget -q " https://$GPG /deb_signing.key" -O /dev/null
288295check_result $? " No access to Hestia repository"
@@ -1102,10 +1109,12 @@ if [ "$named" = 'yes' ]; then
11021109 chown root:bind /etc/bind/named.conf
11031110 chmod 640 /etc/bind/named.conf
11041111 aa-complain /usr/sbin/named 2> /dev/null
1105- echo " /home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
1106- service apparmor status > /dev/null 2>&1
1107- if [ $? -ne 0 ]; then
1108- service apparmor restart
1112+ if [ " $apparmor " = ' yes' ]; then
1113+ echo " /home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
1114+ service apparmor status > /dev/null 2>&1
1115+ if [ $? -ne 0 ]; then
1116+ service apparmor restart
1117+ fi
11091118 fi
11101119 update-rc.d bind9 defaults
11111120 service bind9 start
You can’t perform that action at this time.
0 commit comments