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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
stat(){
|
sys(){
|
||||||
admin
|
admin
|
||||||
total=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
mtot=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||||
avail=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
|
mavl=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
|
||||||
used=$(bc <<< "scale=1; ($total-$avail) / 1024")
|
mem=$(bc <<< "scale=1; ($mtot-$mavl) / 1024")
|
||||||
sendmsg "$(uptime | cut -c2-)
|
ups=$(cut -d. -f1 < /proc/uptime)
|
||||||
I am using ${used}M of memory and \
|
upd=$(bc <<< "$ups / 60 / 60 / 24")
|
||||||
$(df -h / | tail -n1 | awk '{print $3}') of storage."
|
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(){
|
neo(){
|
||||||
@ -294,7 +300,7 @@ case "$cmd" in
|
|||||||
/repo@$bot) repo ;;
|
/repo@$bot) repo ;;
|
||||||
# Administrative
|
# Administrative
|
||||||
/mp3@$bot*) mp3 ;;
|
/mp3@$bot*) mp3 ;;
|
||||||
/stat@$bot) stat ;;
|
/sys@$bot) sys ;;
|
||||||
/neo@$bot) neo ;;
|
/neo@$bot) neo ;;
|
||||||
/term@$bot*) term ;;
|
/term@$bot*) term ;;
|
||||||
# Notes and such
|
# Notes and such
|
||||||
|
Loading…
x
Reference in New Issue
Block a user