Skip to content

Commit d2a7061

Browse files
committed
Add SSH connection check to CPU usage script
1 parent dec6b49 commit d2a7061

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

_posts/2025-05-10-cpu-usage.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ capabilities:
3030
- vars_set
3131
script: |
3232
(function() {
33+
// Check if the SSH connection is active, if not, return empty label and default icon
34+
if (!$ssh.isConnected()) {
35+
return {
36+
label: '',
37+
icon: 'tachometer'
38+
};
39+
}
40+
3341
/**
3442
* Parse the first “cpu” line of /proc/stat and compute
3543
* - total time (sum of all fields)

0 commit comments

Comments
 (0)