]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix mount-media volume assignment
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 20 Oct 2016 12:03:43 +0000 (10:03 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 20 Oct 2016 12:03:43 +0000 (10:03 -0200)
share/hydractl/mount-media

index 468eb7e90a034cfe05a832501659d1a60ce91fae..c25eee372e24073b527c4acae58a4fb11ca014d3 100755 (executable)
@@ -28,8 +28,8 @@ if [ -z "$VOLUME" ]; then
 fi
 
 # Disk and device config
-DISK="`echo ${VOLUME} | sed -e s/[0-9]\$//g`"
-DEVICE="/dev/$DISK"
+DISK="/dev/`echo ${VOLUME} | sed -e s/[0-9]\$//g`"
+DEVICE="/dev/$VOLUME"
 
 # Check if LVM
 if $sudo lvdisplay /dev/$MEDIA/root &> /dev/null; then
@@ -41,10 +41,10 @@ fi
 if [ "$BASENAME" == "mount-media" ]; then
   if [ -e "$DEVICE" ]; then
     echo "Checking drive health status..."
-    $sudo smartctl -H /dev/$DISK
+    $sudo smartctl -H $DISK
 
     echo "Disabling STANDBY on drive..."
-    $sudo sdparm --clear STANDBY -6 /dev/$DISK
+    $sudo sdparm --clear STANDBY -6 $DISK
   fi
 
   if [ "$LVM" == "yes" ]; then