Add refresh command
authorBryn M. Reeves <bmr@redhat.com>
Tue, 22 Jan 2013 13:19:53 +0000 (13:19 +0000)
committerBryn M. Reeves <bmr@redhat.com>
Tue, 22 Jan 2013 13:19:53 +0000 (13:19 +0000)
Add a new 'refresh' command to allow the user to refresh a single
alias by name.

blkdevalias

index 6b23bed..e7a9688 100755 (executable)
@@ -233,6 +233,15 @@ ba_chown_configs () {
     return 0
 }
 
+# ba_refresh_alias <alias>
+ba_refresh_alias () {
+    local _ALIAS _DEVPATH
+    _ALIAS="$1"
+    _DEVPATH="/dev/$BA_DEV_PATH/$_ALIAS"    
+    _debug "ba_refresh_alias: ALIAS=$_ALIAS DEVPATH=$_DEVPATH"
+    ba_refresh_device $_DEVPATH
+}
+
 # ba_refresh_device <dev path>
 ba_refresh_device () {
     local _DEVPATH _DEVNAME _LINKDEST
@@ -424,7 +433,6 @@ ba_querydisk () {
 
 ba_scandisks () {
     local _DEV _TARGET _REFRESH
-    echo $1
     if [ "x$1" == "x-r" ]; then
         _REFRESH="yes"
     else
@@ -485,22 +493,25 @@ case "$1" in
         ba_configure
         ;;
     create*)
-        ba_createdisk $2 $3
+        ba_createdisk "$2" "$3"
         ;;
     delete*)
-        ba_deletedisk $2
+        ba_deletedisk "$2"
         ;;
     list*)
         ba_list_disks
         ;;
     query*)
-        ba_querydisk $2 $3
+        ba_querydisk "$2" "$3"
         ;;
     scan*)
-        ba_scandisks $2
+        ba_scandisks "$2"
+        ;;
+    refresh*)
+        ba_refresh_alias "$2"
         ;;
     map)
-        ba_map $2
+        ba_map "$2"
         ;;
     *)
         ba_usage "\n{configure|createdisk|deletedisk|listdisks|scandisks|querydisk|map}"