git ssb

0+

Dominic / killfree



Tree: 23f9743fb4337640544f9e1d43e9560f54b7b4f0

Files: 23f9743fb4337640544f9e1d43e9560f54b7b4f0 / index.sh

275 bytesRaw
1#! /bin/bash
2
3over () {
4 return $(free | head -n 2 | tail -n 1 | awk ' { print(($4+$7)/$2) <= 0.3 }')
5}
6
7KILL () {
8 echo KILL ALL BROWSERS!
9 pkill chromium
10 pkill firefox
11 pkill electron
12}
13
14while true; do
15 echo date
16 free
17 over && echo "SAFE" || KILL
18 sleep 1
19done
20
21
22

Built with git-ssb-web