mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 05:14:10 -07:00
apparmor check
This commit is contained in:
parent
36e2586c76
commit
38b54ee937
1 changed files with 14 additions and 4 deletions
|
@ -260,6 +260,14 @@ if [ ! -e '/usr/bin/wget' ]; then
|
||||||
check_result $? "Can't install wget"
|
check_result $? "Can't install wget"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if apparmor is installed
|
||||||
|
# This check is borrowed from HestiaCP
|
||||||
|
if [ $(dpkg-query -W -f='${Status}' apparmor 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||||
|
apparmor='no'
|
||||||
|
else
|
||||||
|
apparmor='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
# Checking repository availability
|
# Checking repository availability
|
||||||
wget -q "apt.vesta.hostingpanel.dev/deb_signing.key" -O /dev/null
|
wget -q "apt.vesta.hostingpanel.dev/deb_signing.key" -O /dev/null
|
||||||
check_result $? "No access to Vesta repository"
|
check_result $? "No access to Vesta repository"
|
||||||
|
@ -1065,11 +1073,13 @@ if [ "$named" = 'yes' ]; then
|
||||||
chown root:bind /etc/bind/named.conf
|
chown root:bind /etc/bind/named.conf
|
||||||
chmod 640 /etc/bind/named.conf
|
chmod 640 /etc/bind/named.conf
|
||||||
aa-complain /usr/sbin/named 2>/dev/null
|
aa-complain /usr/sbin/named 2>/dev/null
|
||||||
|
if [ "$apparmor" = 'yes' ]; then
|
||||||
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2>/dev/null
|
echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2>/dev/null
|
||||||
service apparmor status >/dev/null 2>&1
|
service apparmor status >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
service apparmor restart
|
service apparmor restart
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
update-rc.d bind9 defaults
|
update-rc.d bind9 defaults
|
||||||
service bind9 start
|
service bind9 start
|
||||||
check_result $? "bind9 start failed"
|
check_result $? "bind9 start failed"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue