Update watch_lvm.sh
Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
@@ -86,26 +86,25 @@ while true; do
|
|||||||
echo "Disk $disk has partitions. Skipping."
|
echo "Disk $disk has partitions. Skipping."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# Check if the VG is already active
|
|
||||||
vg_active=$(vgdisplay "$VG_NAME" | grep "VG Status" | awk '{print $3}')
|
# Check if the VG is already active
|
||||||
|
vg_active=$(vgdisplay "$VG_NAME" | grep "VG Status" | awk '{print $3}')
|
||||||
if [ "$vg_active" == "available" ]; then
|
|
||||||
echo "Volume group $VG_NAME is already active."
|
if [ "$vg_active" == "available" ]; then
|
||||||
else
|
echo "Volume group $VG_NAME is already active."
|
||||||
echo "Activating volume group $VG_NAME..."
|
|
||||||
vgchange -ay "$VG_NAME"
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Volume group $VG_NAME has been activated."
|
|
||||||
else
|
else
|
||||||
echo "Failed to activate volume group $VG_NAME."
|
echo "Activating volume group $VG_NAME..."
|
||||||
|
vgchange -ay "$VG_NAME" || echo "Failed to activate volume group $VG_NAME."
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Volume group $VG_NAME has been activated."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Configuration file not found. Exiting."
|
echo "Configuration file not found. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "sleeping 60 seconds"
|
||||||
sleep 60 # Sleep for 1 minute before checking again
|
sleep 60 # Sleep for 1 minute before checking again
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user