From 12ceb6ac9d36e57a28b9e673d54a58b3efe2e5ee Mon Sep 17 00:00:00 2001 From: VR-25 <28943176+VR-25@users.noreply.github.com> Date: Mon, 6 Jun 2022 11:34:56 +0100 Subject: [PATCH] --parse: exclude all known switches --- install/acc.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/acc.sh b/install/acc.sh index cdfac45..3dfc0f2 100644 --- a/install/acc.sh +++ b/install/acc.sh @@ -209,11 +209,12 @@ parse_switches() { *) continue;; esac + i=${i#/sys/class/power_supply/} + # exclude all known switches ! grep -q "$i " $1 || continue - i="$(echo "$i $n" | grep -Eiv 'brightness|curr|online|present|runtime|status|temp|volt|wakeup|[^pP]reset|daemon|calibrat|init|resistance|capacitance|shutdown|parallel|cycle|shutdown|reboot|nvram|count' \ - | sed 's|^/.*/power_supply/||')" + i="$(echo "$i $n" | grep -Eiv 'brightness|curr|online|present|runtime|status|temp|volt|wakeup|[^pP]reset|daemon|calibrat|init|resistance|capacitance|shutdown|parallel|cycle|shutdown|reboot|nvram|count')" [ -z "$i" ] || echo "$i"