Commit 1c3a6817 authored by Peter Möller's avatar Peter Möller

Added clarification on the firewall: is it active or not?

parent da7c1035
......@@ -48,7 +48,13 @@ Authentication="$(if [ -n "$(egrep -v "#|^$" /etc/pam.d/common-account | egrep p
AuthStr="\"authentication\": \"${Authentication}\"" # Ex: AuthStr='"authentication": "Lucat"'
# Firewall. Ex: Firewall=ufw
Firewall="$(systemctl list-units --type=service --state=active | egrep -i "^\ *(iptables|firewalld|ufw)" | awk '{print $1}' | cut -d\. -f1)"
FirewWStr="\"firewall\":\"${Firewall}\"" # Ex: FirewWStr='"firewall":"ufw"'
# Is it acive?
case "$Firewall" in
"ufw") FirewallStatus="$(/usr/sbin/ufw status 2>/dev/null | awk '/Status:/ {print $NF}')";;
"firewalld") FirewallStatus="$(firewall-cmd --state)";;
"*") FirewallStatus="unknown status";;
esac
FirewallStr="${Firewall} ($FirewallStatus)" # Ex: FirewallStr='ufw (inactive)'
# Disks
Filesystems="$(df -kB1 -T -t xfs -t ext4 | egrep "\/" | awk '{print $1" "$2" "$3" "$7}')"
# Ex: a number of rows with
......@@ -240,7 +246,7 @@ NetworkStr="\"network\": { \"hostname\": \"$(hostname -f)\"$AliasName }"
CPUstr="\"cpu\": { \"name\": \"${CPUModel:---}\", \"threads\": ${NbrCPUs:---} }"
RAMStr="\"memory\": { \"total-kb\": ${RAM:---}, \"type\": \"${ECC:---}\" }"
SysinfoStr="\"sysinfo\": { \"os\": \"${OS:---}\", \"authentication\":\"${Authentication}\", \"firewall\":\"${Firewall}\", \"flags\": [ ${Flags} ], $CPUstr, $RAMStr, $FilesystemStr, $NIStr, $PlatformStr, $NetworkStr }"
SysinfoStr="\"sysinfo\": { \"os\": \"${OS:---}\", \"authentication\":\"${Authentication}\", \"firewall\":\"${FirewallStr}\", \"flags\": [ ${Flags} ], $CPUstr, $RAMStr, $FilesystemStr, $NIStr, $PlatformStr, $NetworkStr }"
# Ex:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment