From 2c50fdbff073d0ece82f0795abd5dbadbdba88b4 Mon Sep 17 00:00:00 2001 From: Ann Cheng Date: Wed, 6 Mar 2024 21:47:39 +0800 Subject: [PATCH] test and use proper package manager cmd --- os-logs/linux-distro-cmds.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/os-logs/linux-distro-cmds.sh b/os-logs/linux-distro-cmds.sh index 35494b8..52ff4a5 100644 --- a/os-logs/linux-distro-cmds.sh +++ b/os-logs/linux-distro-cmds.sh @@ -24,17 +24,23 @@ efibootmgr -t 5 2>&1 |tee efibootmgr-t-5.txt efibootmgr -c 2>&1 |tee efibootmgr-c.txt ifconfig 2>&1 |tee ifconfig.txt ip addr show 2>&1 |tee ip-addr-show.txt -ping -c 5 www.arm.com -ping -c 5 www.arm.com > ping-c-5-www-arm-com.txt -apt-get update -apt-get install -y acpica-tools -yum check-update -yum install -y acpica-tools -dnf check-update -dnf install -y acpica-tools -zypper modifyrepo --all -e -zypper refresh -zypper install acpica +ping -c 5 www.arm.com 2>&1 | tee ping-c-5-www-arm-com.txt +if command -v apt &> /dev/null; then + apt-get update + apt-get install -y acpica-tools +elif command -v yum &> /dev/null; then + yum check-update + yum install -y acpica-tools +elif command -v zypper &> /dev/null; then + zypper modifyrepo --all -e + zypper refresh + zypper install acpica +elif command -v dnf &> /dev/null; then + dnf check-update + dnf install -y acpica-tools +else + echo "Unknown package manager" +fi acpidump > acpi.log acpixtract acpi.log iasl -d *.dat -- GitLab