home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea734d2
)
Take prefixes of net interfaces from CLI options
author
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 27 Jul 2018 20:53:21 +0000
(16:53 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 27 Jul 2018 20:53:21 +0000
(16:53 -0400)
bin/khatus_show
patch
|
blob
|
blame
|
history
diff --git
a/bin/khatus_show
b/bin/khatus_show
index
12263e1
..
b0b87a9
100755
(executable)
--- a/
bin/khatus_show
+++ b/
bin/khatus_show
@@
-6,7
+6,7
@@
BIN=$HOME/bin
STATUS_DIR=$HOME/var/run/status
STATUS_FILE__WIFI=$STATUS_DIR/wifi
STATUS_FILE__ENERGY_NOTIFIED_BELLOW_HALF=$STATUS_DIR/notified_energy_bellow_half
STATUS_DIR=$HOME/var/run/status
STATUS_FILE__WIFI=$STATUS_DIR/wifi
STATUS_FILE__ENERGY_NOTIFIED_BELLOW_HALF=$STATUS_DIR/notified_energy_bellow_half
-while getopts ":b:d:s:" opt
+while getopts ":b:d:s:
i:
" opt
do
case "$opt" in
b)
do
case "$opt" in
b)
@@
-18,6
+18,9
@@
do
s)
DISK_SPACE_DEVICE="$OPTARG"
;;
s)
DISK_SPACE_DEVICE="$OPTARG"
;;
+ i)
+ PREFIXES_OF_INTERFACES_TO_SHOW="$OPTARG"
+ ;;
\?)
echo "Unknown option: $OPTARG" >&2
exit 1
\?)
echo "Unknown option: $OPTARG" >&2
exit 1
@@
-127,7
+130,7
@@
network=$(
ip -s addr \
| awk \
-v wifi_conn="$(cat $STATUS_FILE__WIFI)" \
ip -s addr \
| awk \
-v wifi_conn="$(cat $STATUS_FILE__WIFI)" \
- -v prefixes_of_interfaces_to_show=
'w'
\
+ -v prefixes_of_interfaces_to_show=
"$PREFIXES_OF_INTERFACES_TO_SHOW"
\
'
BEGIN {
bytes_per_unit = 1024 * 1024
'
BEGIN {
bytes_per_unit = 1024 * 1024
This page took
0.036449 seconds
and
4
git commands to generate.