Changeset 276 in MondoRescue for trunk/mindi/analyze-my-lvm
- Timestamp:
- Jan 3, 2006, 5:01:12 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/analyze-my-lvm
r98 r276 1 1 #!/bin/sh 2 2 # 3 # $Id$ 4 # 3 5 4 6 #------------------------- ANALYZE-MY-LVM ----------------------- Hugo Rabson … … 42 44 GetValueFromField() { 43 45 local res 44 cat "$1" | sed s/' '/~/| tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%sm",$1;} else if ($2=="KB") {printf "%sk",$1;} else if ($2=="GB") {printf "%sg",$1;} else {print $0;};}'46 sed s/' '/~/ "$1" | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%sm",$1;} else if ($2=="KB") {printf "%sk",$1;} else if ($2=="GB") {printf "%sg",$1;} else {print $0;};}' 45 47 } 46 48 … … 244 246 # -------------------------------- main ----------------------------------- 245 247 which lvmdiskscan 2>/dev/null 2>&1 || Die "Cannot find lvmdiskscan. Are you sure you're using LVM?" 246 if [ -e "/proc/lvm/global" ] && [ "` cat /proc/lvm/global | tr -s '\t' ' '| grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then248 if [ -e "/proc/lvm/global" ] && [ "`tr -s '\t' ' ' < /proc/lvm/global | grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then 247 249 exit 0 248 250 fi
Note:
See TracChangeset
for help on using the changeset viewer.