Add new scripts for system monitoring and remove deprecated scripts
This commit is contained in:
13
scripts/neticon
Executable file
13
scripts/neticon
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Wifi
|
||||
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ]; then
|
||||
wifiicon="$(awk '/^[[:space:]]*w/ { gsub(/[[:space:]]+/, " "); print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ]; then
|
||||
wifiicon=" "
|
||||
fi
|
||||
|
||||
# Ethernet
|
||||
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon=" " || ethericon=" "
|
||||
|
||||
printf "%s%s\n" "$wifiicon" "$ethericon"
|
||||
Reference in New Issue
Block a user