Take prefixes of net interfaces from CLI options
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 27 Jul 2018 20:53:21 +0000 (16:53 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 27 Jul 2018 20:53:21 +0000 (16:53 -0400)
bin/khatus_show

index 12263e1..b0b87a9 100755 (executable)
@@ -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
-while getopts ":b:d:s:" opt
+while getopts ":b:d:s:i:" opt
 do
     case "$opt" in
         b)
@@ -18,6 +18,9 @@ do
         s)
             DISK_SPACE_DEVICE="$OPTARG"
             ;;
+        i)
+            PREFIXES_OF_INTERFACES_TO_SHOW="$OPTARG"
+            ;;
         \?)
             echo "Unknown option: $OPTARG" >&2
             exit 1
@@ -127,7 +130,7 @@ network=$(
     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
This page took 0.024452 seconds and 4 git commands to generate.