aboutsummaryrefslogtreecommitdiff
path: root/segments/ifstat.sh
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2017-04-20 19:37:10 -0600
committerCody Hiar <codyfh@gmail.com>2017-04-20 19:37:10 -0600
commit2dd809781527976307b47a598887062047e202c9 (patch)
tree8b29daba2c1ef072f380ef530b7e7d9256e43eb3 /segments/ifstat.sh
parentbaeb698bb006193559fc5aa1901180a3ccc73b7a (diff)
Making tmux configuration much easier to manage
Diffstat (limited to 'segments/ifstat.sh')
-rwxr-xr-xsegments/ifstat.sh39
1 files changed, 0 insertions, 39 deletions
diff --git a/segments/ifstat.sh b/segments/ifstat.sh
deleted file mode 100755
index 2666496..0000000
--- a/segments/ifstat.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-# Show network statistics for all active interfaces found.
-
-run_segment() {
- type ifstat >/dev/null 2>&1
- if [ "$?" -ne 0 ]; then
- return 1
- fi
-
- sed="sed"
- type gsed >/dev/null 2>&1
- if [ "$?" -eq 0 ]; then
- sed="gsed"
- fi
-
- data=$(ifstat -z -S -q 1 1)
- interfaces=$(echo -e "${data}" | head -n 1)
- flow_data=$(echo -e "${data}" | tail -n 1 | ${sed} "s/\s\{1,\}/,/g")
- index=1
- for inf in ${interfaces}; do
- type=""
- case ${inf} in
- eth*) type="⎆"
- ;;
- wlan*) type="☫"
- ;;
- en*) type=" "
- ;;
- esac
- if [ -n "${type}" ]; then
- formate=$(echo "${formate} ${type} ⇊ %.2f ⇈ %.2f")
- holder=$(echo "${holder},\$$((index)),\$$((index+1))")
- fi
- index=$((index+2))
- done
- if [ -n "${formate}" ]; then
- echo $(echo "${flow_data#,}" | awk -F"," "{printf(\"${formate}\"${holder})}")
- fi
- return 0
-}