mirror of
https://github.com/hardenedlinux/harbian-audit.git
synced 2025-07-31 01:24:58 +02:00
Add a method to determine the system version for compatibility.
This commit is contained in:
parent
2e0435363c
commit
1570943606
@ -34,7 +34,7 @@ audit_debian () {
|
|||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
ok "$PACKAGE is installed"
|
ok "$PACKAGE is installed"
|
||||||
# Since Debian 10 (Buster), AppArmor is enabled by default. It's a system service
|
# Since Debian 10 (Buster), AppArmor is enabled by default. It's a system service
|
||||||
is_debian_10
|
is_debian_ge_10
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
is_service_active $SERVICENAME
|
is_service_active $SERVICENAME
|
||||||
if [ $FNRET -eq 0 ]; then
|
if [ $FNRET -eq 0 ]; then
|
||||||
@ -101,7 +101,7 @@ apply_debian () {
|
|||||||
done
|
done
|
||||||
elif [ $FNRET = 2 ]; then
|
elif [ $FNRET = 2 ]; then
|
||||||
# Since Debian 10 (Buster), AppArmor is enabled by default. It's a system service
|
# Since Debian 10 (Buster), AppArmor is enabled by default. It's a system service
|
||||||
is_debian_10
|
is_debian_ge_10
|
||||||
if [ $FNRET = 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
warn "Start $SERVICENAME"
|
warn "Start $SERVICENAME"
|
||||||
systemctl start $SERVICENAME
|
systemctl start $SERVICENAME
|
||||||
|
16
lib/utils.sh
16
lib/utils.sh
@ -20,6 +20,22 @@ is_centos_8()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_debian_ge_10()
|
||||||
|
{
|
||||||
|
if [ -r /etc/debian_version ]; then
|
||||||
|
if [ $(cat /etc/debian_version | awk -F"." '{print $1}') -ge 10 ]; then
|
||||||
|
debug "Debian version is greater than or equal to 10"
|
||||||
|
FNRET=0
|
||||||
|
else
|
||||||
|
debug "Debian version is less than 10"
|
||||||
|
FNRET=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
debug "Current OS is not Debian."
|
||||||
|
FNRET=2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
is_debian_ge_9()
|
is_debian_ge_9()
|
||||||
{
|
{
|
||||||
if [ -r /etc/debian_version ]; then
|
if [ -r /etc/debian_version ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user