Commit da7c1035 authored by root's avatar root

Added flag for unattended-upgrades

parent fcc93b29
......@@ -69,6 +69,18 @@ CPUBugs="$(egrep "^bugs" /proc/cpuinfo | cut -d: -f2 | cut -c2- | uniq)"
Kernel="$(uname -r 2>/dev/null)" # Ex: Kernel=5.4.0-62-generic
Architecture="$(uname -m 2>/dev/null)" # Ex: Architecture=x86_64
Uptime="$(awk '{print int($1/86400)}' /proc/uptime)"
# unattended-upgrades
case $(systemctl status unattended-upgrades &>/dev/null; echo $?) in
0) UnattendedUpgrades="Active";;
1) UnattendedUpgrades="Generic failure or unspecified error";;
2) UnattendedUpgrades="Invalid or excess arguments";;
3) UnattendedUpgrades="Unimplemented";;
4) UnattendedUpgrades="Not installed";;
5) UnattendedUpgrades="Not installed";;
6) UnattendedUpgrades="Not configured";;
7) UnattendedUpgrades="Not running";;
esac
# Is reboot required?
UbuntuReboot() {
if [ -f /var/run/reboot-required ]; then
......@@ -178,7 +190,7 @@ FWrules="$(ufw status verbose 2>/dev/null | egrep "(ALLOW|DENY) IN" | awk '{prin
# Create a string for the CPU Bugs (to make the final assemble shorter)
CPUBugsStr="$(if [ -n "$CPUBugs" ]; then echo ", \"cpu-bugs:${CPUBugs// /\", \"cpu-bugs:}\""; fi)"
# Assemble the Flags string
Flags="\"selinux:$SELinux\", \"kernel:${Kernel}\"$CPUBugsStr, \"arch:${Architecture:---}\", \"fail2ban:$Fail2Ban\", \"Uptime-days:$Uptime\", \"Reboot-required:$RebootRequired\""
Flags="\"selinux:$SELinux\", \"kernel:${Kernel}\"$CPUBugsStr, \"arch:${Architecture:---}\", \"fail2ban:$Fail2Ban\", \"Uptime-days:$Uptime\", \"Reboot-required:$RebootRequired\", \"unattended-upgrades:$UnattendedUpgrades\""
# partitions
OUTPUT=""
......
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