[Lunar-commits] <lunar-tools> lnet: only show configured devices under manage menu

Stefan Wold ratler at lunar-linux.org
Sat Oct 5 17:27:39 CEST 2013


commit 945359f40da221a74b920569a991ffb5d66b2e1c
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Sat, 05 Oct 2013 08:23:59 -0700
URL: https://github.com/lunar-linux/lunar-tools/commit/945359f40da221a74b920569a991ffb5d66b2e1c

lnet: only show configured devices under manage menu

Since systemd is used to up/down an interface we must list
configured devices.
---
  prog/lnet | +3/-7     
  1 file changed, 3 insertions(+), 7 deletions(-)

--- a/prog/lnet
+++ b/prog/lnet
@@ -292,19 +292,15 @@ function ethernet_menu() {
 
 function ethernet_manage_menu() {
   NO_INTERFACES="There are no interfaces to be listed. You may want to configure a device first."
-  FORMAT="%-6s %-15s"
+  FORMAT="%-15s %-6s"
 
   while true; do
     unset INTERFACES STR
     COUNTER=0
     LIST=()
-    for DEVICE in $(get_dev_list); do
+    for DEVICE in $(get_configured_dev_list); do
       INTERFACES[$COUNTER]=$DEVICE
-      STATUS=$(get_dev_status $DEVICE)
-      STR=$(printf "$FORMAT" $STATUS $DEVICE)
-      if [ ! -f "$CONFIG_DIR/$DEVICE" ]; then
-        STR+=" (unconfigured)"
-      fi
+      STR=$(printf "$FORMAT" $DEVICE $(get_dev_status $DEVICE))
       LIST+=($COUNTER "$STR")
       (( COUNTER++ ))
     done




More information about the Lunar-commits mailing list