diff options
author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-01-15 06:37:07 (GMT) |
---|---|---|
committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-01-15 06:37:07 (GMT) |
commit | 875e220a0acd358747579051bda5bfa2224227f6 (patch) | |
tree | d93c8945506dfbf4e7600cfdca652026e28bd0b9 /abs/core-testing/LinHES-config | |
parent | 7309564d9f5afd0d6ef985f1eecb678c8fe7cf0d (diff) | |
parent | 3e16300236c102f1d7752f67728a322cdf3ec853 (diff) | |
download | linhes_pkgbuild-875e220a0acd358747579051bda5bfa2224227f6.zip linhes_pkgbuild-875e220a0acd358747579051bda5bfa2224227f6.tar.gz linhes_pkgbuild-875e220a0acd358747579051bda5bfa2224227f6.tar.bz2 |
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/core-testing/LinHES-config')
4 files changed, 66 insertions, 25 deletions
diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index 76754da..c25ee7e 100755 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=1.0 -pkgrel=178 +pkgrel=191 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev ) pkgdesc="Install and configure your system" depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan ) diff --git a/abs/core-testing/LinHES-config/install_functions.sh b/abs/core-testing/LinHES-config/install_functions.sh index b412663..fd84d6c 100755 --- a/abs/core-testing/LinHES-config/install_functions.sh +++ b/abs/core-testing/LinHES-config/install_functions.sh @@ -446,10 +446,17 @@ case $1 in FOUNDUUID="" if [ x$4 = x ] then + #upgrade + find_uuid ${2}3 + elif [ x$5 = xFULL_INSTALL ] + then + #install find_uuid ${2}3 else + #upgrade with non statndard myth find_uuid $4 fi + DATAUUID=$FOUNDUUID 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 diff --git a/abs/core-testing/LinHES-config/restore_default_settings.sh b/abs/core-testing/LinHES-config/restore_default_settings.sh index 46c5fc9..5a02886 100755 --- a/abs/core-testing/LinHES-config/restore_default_settings.sh +++ b/abs/core-testing/LinHES-config/restore_default_settings.sh @@ -29,7 +29,9 @@ function CMD_DEFINE () { } function SQL_DEFINE () { - thostname=`echo ${hostname}|tr - _` + thostname=`echo ${hostname}|tr -C [:alpha:] _` + echo "Using $thostname for temp table postfix" + #$1 is the table name if [ $1 = "settings" ] then |