diff options
author | Simon Rettberg | 2019-06-12 16:40:46 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-06-12 16:40:46 +0200 |
commit | d4d41754078190789b2ab1c7b881d5cfa29f7efe (patch) | |
tree | 19f50d33cad475c4a76aa602ec3e0ac1a9f6ef01 /core/modules/hardware-stats | |
parent | [vmchooser2] Show screen saver disable checkbox if applicable (diff) | |
download | mltk-d4d41754078190789b2ab1c7b881d5cfa29f7efe.tar.gz mltk-d4d41754078190789b2ab1c7b881d5cfa29f7efe.tar.xz mltk-d4d41754078190789b2ab1c7b881d5cfa29f7efe.zip |
[hardware-stats] Use idle-daemon to warn users of low mem
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-x | core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update index 89df8e74..14e08e68 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update @@ -72,33 +72,7 @@ Please save your work and reboot this machine. Sie können einen bwLehrpool-Admin bitten, eine größere ID-44-Partition einzurichten. You could ask a bwLehrpool administrator to create a larger ID-44 partition." - for d in $(who | awk '{print $2}' | sort -u); do - if [ "${d:0:1}" = ":" ]; then - # X11 - export DISPLAY=$d - export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') - notify-send -u critical "System instabil" "$WARN" - unset DISPLAY XAUTHORITY - elif [ "${d:0:3}" = "tty" ]; then - # Regular tty - cat > "/dev/$d" <<EOF - * - *************************** - $WARN - *************************** - * -EOF - elif [ "${d:0:3}" = "pts" ]; then - # pts - xterm or ssh session - cat > "/dev/pts/${d:3}" <<EOF - * - *************************** - $WARN - *************************** - * -EOF - fi - done + idle-daemon --send "warn $WARN" fi exit 0 |