diff options
Diffstat (limited to 'abs')
-rwxr-xr-x | abs/core-testing/live-installer/restore_default_settings.sh | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/abs/core-testing/live-installer/restore_default_settings.sh b/abs/core-testing/live-installer/restore_default_settings.sh index e2b7044..5690f48 100755 --- a/abs/core-testing/live-installer/restore_default_settings.sh +++ b/abs/core-testing/live-installer/restore_default_settings.sh @@ -67,7 +67,7 @@ if [ $# -eq 0 ] then echo "Valid options are:" echo " -c (save|restore|load|uhostname|BECONFIG|ZIP|ACCESSCONTROL)" - echo " -t (syssettings)" + echo " -t (syssettings|hostsettings)" echo " -d databasename" echo " -h hostname" echo " -s systemtype (master|slave|standalone|frontendonly)" @@ -94,11 +94,17 @@ do Thistemplate=$OPTARG if [ x$Thistemplate = x"syssettings" ] - then - echo "" - else - echo "invalid template name" - exit 1 + then + echo "template is syssettings" + loadhost=false + elif [ x$Thistemplate = x"hostsettings" ] + then + echo "template is hostsettings" + Thistemplate=syssettings + loadhost=true + else + echo "invalid template name" + exit 1 fi ;; d) echo "$SWITCH" "$OPTARG" @@ -165,22 +171,40 @@ case $OPERATION in #used to restore settings from syssettings if [ -d $TEMPLATES/$Thistemplate ] then - cd $TEMPLATES/$Thistemplate - for i in $TABLES - do - SQL_DEFINE $i - sed -e "s/REPLACEME/$hostname/g" $i.txt > /tmp/$i.txt - #echo $MYSQLCMD "$SELECTSQL" - echo $i - $MYSQLCMD "$CREATESQL" - $MYSQLCMD "$ALTERSQL" - $MYSQLCMD "$COPY_TMP_SQL" - $MYSQLCMD "$INSERTSQL" - $MYSQLCMD "$DROPSQL" - $MYSQLCMD "$COPY_BCK_SQL " - $MYSQLCMD "$DROP_TABLE " - #rm /tmp/$i.txt - done + cd $TEMPLATES/$Thistemplate + if [ $loadhost = false ] + then + for i in $TABLES + do + SQL_DEFINE $i + sed -e "s/REPLACEME/$hostname/g" $i.txt > /tmp/$i.txt + #echo $MYSQLCMD "$SELECTSQL" + echo $i + $MYSQLCMD "$CREATESQL" + $MYSQLCMD "$ALTERSQL" + $MYSQLCMD "$COPY_TMP_SQL" + $MYSQLCMD "$INSERTSQL" + $MYSQLCMD "$DROPSQL" + $MYSQLCMD "$COPY_BCK_SQL " + $MYSQLCMD "$DROP_TABLE " + #rm /tmp/$i.txt + done + fi + if [ $loadhost = true ] + then + #only load the settings table with values HOST + i=settings + SQL_DEFINE $i + sed -e "s/REPLACEME/$hostname/g" $i.txt > /tmp/$i.txt + echo $i + $MYSQLCMD "$CREATESQL" + $MYSQLCMD "$ALTERSQL" + $MYSQLCMD "$INSERTSQL" + $MYSQLCMD "$COPY_TMP_SQL" + $MYSQLCMD "$DROPSQL" + $MYSQLCMD "$COPY_BCK_SQL" + $MYSQLCMD "$DROP_TABLE " + fi else echo "couldn't find $TEMPLATES/$Thistemplate" fi |