summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-config/install_proxy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/LinHES-config/install_proxy.sh')
-rwxr-xr-xabs/core-testing/LinHES-config/install_proxy.sh78
1 files changed, 55 insertions, 23 deletions
diff --git a/abs/core-testing/LinHES-config/install_proxy.sh b/abs/core-testing/LinHES-config/install_proxy.sh
index 175d7f9..011dfac 100755
--- a/abs/core-testing/LinHES-config/install_proxy.sh
+++ b/abs/core-testing/LinHES-config/install_proxy.sh
@@ -90,20 +90,55 @@ function backup_sql_check {
return $rc
}
+function mdadm_assemble_all {
+
+ mdadm_find /tmp
+ mdadm --assemble --scan -c /tmp${MDADM_CONF}
+ MDLIST=`grep ARRAY /tmp${MDADM_CONF}|tr -s [:space:]|cut -d" " -f2`
+ for array in $MDLIST
+ do
+ echo "assembling array $array"
+ mdadm --assemble -c /tmp${MDADM_CONF} $array
+ sleep 2
+ fsck -p $array
+ done
+
+}
+
function upgrade_mount_search {
MYTH_P=`cat /tmp/etc/fstab |grep -E /myth[[:space:]] | awk ' {print $1 '} `
umount $mountpoint/myth
+
+ #should probably just mdadm all the time
echo $MYTH_P |grep -q \/md.
if [ $? = 0 ]
then
- mdadm_find /tmp
- mdadm --assemble -c /tmp${MDADM_CONF} $MYTH_P
- sleep 2
- fsck -p $MYTH_P
+ mdadm_assemble_all
+ fi
+
+ echo $MYTH_P |grep -q UUID
+ if [ $? = 0 ]
+ then
+ MUUID=`echo $MYTH_P|cut -d= -f2|tr -d \"`
+ echo blkid $MUUID
+ blkid -t UUID=$MUUID
+ if [ ! $? = 0 ]
+ then
+ echo "couldn't find $MUUID, starting md support"
+ mdadm_assemble_all
+ fi
+ mount -U $MUUID $mountpoint/myth
+ echo mount -U $MUUID $mountpoint/myth
+ MYTHMOUNT=`blkid -t UUID=$MUUID|cut -d: -f1`
+ MYTHMOUNT=`basename $MYTHMOUNT`
+ echo "MYTHMOUNT is $MYTHMOUNT"
+ else
+ mount $MYTH_P $mountpoint/myth
+ echo mount $MYTH_P $mountpoint/myth
+ MYTHMOUNT=`basename $MYTH_P`
+ echo "MYTHMOUNT is $MYTHMOUNT"
fi
- mount $MYTH_P $mountpoint/myth
- echo mount $MYTH_P $mountpoint/myth
sleep 2
backup_sql_check
if [ $? = 1 ]
@@ -117,8 +152,6 @@ function upgrade_mount_search {
BACKUPFILE="/root/backup/mythconverg.sql.gz"
echo "setting BACKUPFILE to $BACKUPFILE"
fi
- else
- MYTHMOUNT=`basename $MYTH_P`
fi
return 0
}
@@ -548,11 +581,11 @@ echo "-----------------------------------------------------------------------3--
echo "network check myself"
ifconfig
ping -c 1 $myipdefault
- if [ ! $? = 0 ]
- then
- exit 3
- #can't ping yourself
- fi
+ if [ ! $? = 0 ]
+ then
+ exit 3
+ #can't ping yourself
+ fi
;;
check_gw)
#check gateway
@@ -590,7 +623,7 @@ echo "-----------------------------------------------------------------------3--
;;
host_names)
#if host is found, then check to see if it's online
- #if not online, assume it's ok to use this hostname
+ #if hoip matchs my ip assume it's ok
echo "network check my hostname $hostname"
hout=`host $hostname`
status=$?
@@ -598,21 +631,20 @@ echo "-----------------------------------------------------------------------3--
if [ $status = 0 ]
then
hoip=`echo $hout|awk '{print $4}'`
- ping -c 1 $hoip
+ /sbin/ifconfig -a |grep -q $hoip
if [ $? = 0 ]
then
+ echo "DNS ip matches on of my ips"
status=0
else
- status=1
+ echo "IP in DNS but doesn't match mine, hostname is not safe to use"
+ status=7
fi
+ else
+ echo "Couldn't find hostname in DNS, must be safe to use"
+ status=0
fi
-
- if [ $status = 0 ]
- then
- exit 7
- fi
-
-
+ exit $status
;;
esac