aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorGravatar Andres Erbsen <andreser@mit.edu>2017-06-18 17:12:22 -0400
committerGravatar Andres Erbsen <andreser@mit.edu>2017-06-18 17:12:22 -0400
commit694c4878a779faa6d139f683928d11b98c0db812 (patch)
treeae86cb91d7964c9afe53c1bd5688fb97de6d06ef /etc
parenta8704962d028da590cb2adb521e47d247fc8373c (diff)
handle missing /sys/class/power_supply/AC
Diffstat (limited to 'etc')
-rwxr-xr-xetc/machine.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/machine.sh b/etc/machine.sh
index 63b9897d0..06cea8ac4 100755
--- a/etc/machine.sh
+++ b/etc/machine.sh
@@ -7,7 +7,11 @@ grep -q '[^0-9]' /sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list
printf -
grep -q 1 /sys/devices/system/cpu/intel_pstate/no_turbo && printf notb || printf tb
printf -
-grep -q 1 /sys/class/power_supply/AC/online && printf ac || printf noac
+if [ -f /sys/class/power_supply/AC/online ]; then
+ grep -q 1 /sys/class/power_supply/AC/online && printf ac || printf noac
+else
+ printf nops
+fi
printf -
printf "$(gcc -march=native -Q --help=target|grep march | cut -d= -f2 | grep -ow '\S*')"
printf -