Skip to content

Commit d3d1b56

Browse files
committed
Check if apparmor is installed.
1 parent d47f9ad commit d3d1b56

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

install/hst-install-debian.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ if [ ! -e '/usr/lib/apt/methods/https' ]; then
283283
check_result $? "Can't install apt-transport-https"
284284
fi
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
287294
wget -q "https://$GPG/deb_signing.key" -O /dev/null
288295
check_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

0 commit comments

Comments
 (0)