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