From 6c3c7d73731c69bc62774115391858e0daf04c00 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sat, 10 Dec 2022 17:35:19 +0000 Subject: [PATCH] system-info clean up cache file in WSL too --- system-info/system-info-WSL.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system-info/system-info-WSL.sh b/system-info/system-info-WSL.sh index d42f3aa..1fbbc0e 100755 --- a/system-info/system-info-WSL.sh +++ b/system-info/system-info-WSL.sh @@ -8,6 +8,10 @@ if [ ! -d $cache_dir ]; then mkdir -p $cache_dir fi +# Cleanup cache file when interrupted. +trap '[ -f $cache_file ] && rm $cache_file; exit' INT +trap '[ -f $cache_file ] && rm $cache_file; exit' TERM + if cat /proc/cpuinfo | grep -i intel > /dev/null; then cpu_temp_sensor="/intelcpu/0/temperature/0" elif cat /proc/cpuinfo | grep -i amd > /dev/null; then