Streamline /stat with userbot's .sys command
This commit is contained in:
parent
2bf5420f5b
commit
2610afb304
22
konata.sh
22
konata.sh
@ -242,14 +242,20 @@ mp3(){
|
||||
fi
|
||||
}
|
||||
|
||||
stat(){
|
||||
sys(){
|
||||
admin
|
||||
total=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||
avail=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
|
||||
used=$(bc <<< "scale=1; ($total-$avail) / 1024")
|
||||
sendmsg "$(uptime | cut -c2-)
|
||||
I am using ${used}M of memory and \
|
||||
$(df -h / | tail -n1 | awk '{print $3}') of storage."
|
||||
mtot=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||
mavl=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
|
||||
mem=$(bc <<< "scale=1; ($mtot-$mavl) / 1024")
|
||||
ups=$(cut -d. -f1 < /proc/uptime)
|
||||
upd=$(bc <<< "$ups / 60 / 60 / 24")
|
||||
disk=$(df -h / | tail -n1 | awk '{print $3}')
|
||||
load=$(cut -d' ' -f1,2,3 < /proc/loadavg)
|
||||
sendmsg "*System usage stats:*
|
||||
*Memory:* ${mem}M
|
||||
*Disk:* ${disk}
|
||||
*Uptime:* ${upd}d
|
||||
*Load:* ${load}"
|
||||
}
|
||||
|
||||
neo(){
|
||||
@ -294,7 +300,7 @@ case "$cmd" in
|
||||
/repo@$bot) repo ;;
|
||||
# Administrative
|
||||
/mp3@$bot*) mp3 ;;
|
||||
/stat@$bot) stat ;;
|
||||
/sys@$bot) sys ;;
|
||||
/neo@$bot) neo ;;
|
||||
/term@$bot*) term ;;
|
||||
# Notes and such
|
||||
|
Loading…
x
Reference in New Issue
Block a user