All pastes #712929 Raw Edit

Mine

public text v1 · immutable
#712929 ·published 2007-09-25 18:54 UTC
rendered paste body
#!/bin/sh

# Written by Bob Bomar

# Variable setup
SSSU="/usr/sbin/sssu"
BIN="/home/bob/work"

# First determine the host.
HOST=`hostname | awk -F"." '{print $1}'`

# Create a temp directory
TEMP=`mktemp -d /tmp/XXXXX`

# Now determine what disks are currently presented.
fdisk -l 2> /dev/null | grep "/dev/s" | awk '{print $2}' | sed 's/://' 1> ${TEMP}/disks_present

# Now determine the existing disk structure
grep "/dev/sd" /etc/fstab | awk '{print $2}' 1> ${TEMP}/fstab_existing

# Now get the presented LUN's
${BIN}/get_luns.sssu | grep -A 1 "Lun" | grep -v "\-\-" | sed 'N;s/\n//' | sed 's/.* L/L/' | sort -k 3 | awk -F":" '{print $NF}' | awk -F"\" '{print $(NF-1)}' | tr '[A-Z]' '[a-z]' > ${TEMP}/luns_presented

echo "Existing Disk Structure:"
cat ${TEMP}/fstab_existing
echo "******"
echo "Disks currently presented:"
cat ${TEMP}/disks_present
echo "******"
echo "LUNS Presented"
cat ${TEMP}/luns_presented

# Cleanup
rm -rf ${TEMP}

# Clean exit
exit 0