diff options
Diffstat (limited to 'build_tools/clarch')
3 files changed, 129 insertions, 9 deletions
diff --git a/build_tools/clarch/larch/profiles/i686-testing-REMOTE/rootoverlay/etc/rc.local b/build_tools/clarch/larch/profiles/i686-testing-REMOTE/rootoverlay/etc/rc.local index fe7cfa6..1047ce4 100755 --- a/build_tools/clarch/larch/profiles/i686-testing-REMOTE/rootoverlay/etc/rc.local +++ b/build_tools/clarch/larch/profiles/i686-testing-REMOTE/rootoverlay/etc/rc.local @@ -5,13 +5,53 @@ . /etc/profile . ${MV_ROOT}/bin/install_functions.sh +function mysql_check { + mysql -e "show databases;" 2>/dev/null >/dev/null + return $? +} + +function mythconverg_check { + mysql mythconverg -e "describe settings;" 2>/dev/null >/dev/null + return $? +} + +function install_db { + pacman --noconfirm -R mythdb-initial 2>/dev/null > /dev/null + pacman -S --noconfirm mythdb-initial 2>/dev/null > /dev/null +} + + #check network parms init_network +#check to see if mysql is running +ATTEMPT=0 +mysql_check && install_db +mythconverg_check +status=$? +while [ ! $status = 0 ] +do + ((ATTEMPT=ATTEMPT+1)) + /etc/rc.d/mysqld stop + sleep 2 + /etc/rc.d/mysqld start + mysqlstatus=$? + if [ $mysqlstatus = 0 ] + then + mysql_check && install_db + mythconverg_check + status=$? + fi + if [ $ATTEMPT = 20 ] + then + echo "Could not start mysql or install mythconverg within 20 attempts" + echo "Aborting install" + exit 20 + fi +done + -#install initial database -pacman -S --noconfirm mythdb-initial 2>/dev/null #search for remote init_remote @@ -26,7 +66,7 @@ else fi -# Set up automatically logged in user (larch live system only) +# Set up automatically logged in user if [ -f /.livesys/autologin ]; then cp /.livesys/autologin /tmp/newuser fi diff --git a/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local b/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local index fe7cfa6..1047ce4 100755 --- a/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local +++ b/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local @@ -5,13 +5,53 @@ . /etc/profile . ${MV_ROOT}/bin/install_functions.sh +function mysql_check { + mysql -e "show databases;" 2>/dev/null >/dev/null + return $? +} + +function mythconverg_check { + mysql mythconverg -e "describe settings;" 2>/dev/null >/dev/null + return $? +} + +function install_db { + pacman --noconfirm -R mythdb-initial 2>/dev/null > /dev/null + pacman -S --noconfirm mythdb-initial 2>/dev/null > /dev/null +} + + #check network parms init_network +#check to see if mysql is running +ATTEMPT=0 +mysql_check && install_db +mythconverg_check +status=$? +while [ ! $status = 0 ] +do + ((ATTEMPT=ATTEMPT+1)) + /etc/rc.d/mysqld stop + sleep 2 + /etc/rc.d/mysqld start + mysqlstatus=$? + if [ $mysqlstatus = 0 ] + then + mysql_check && install_db + mythconverg_check + status=$? + fi + if [ $ATTEMPT = 20 ] + then + echo "Could not start mysql or install mythconverg within 20 attempts" + echo "Aborting install" + exit 20 + fi +done + -#install initial database -pacman -S --noconfirm mythdb-initial 2>/dev/null #search for remote init_remote @@ -26,7 +66,7 @@ else fi -# Set up automatically logged in user (larch live system only) +# Set up automatically logged in user if [ -f /.livesys/autologin ]; then cp /.livesys/autologin /tmp/newuser fi diff --git a/build_tools/clarch/larch/profiles/i686-testing-local/rootoverlay/etc/rc.local b/build_tools/clarch/larch/profiles/i686-testing-local/rootoverlay/etc/rc.local index fe7cfa6..1047ce4 100755 --- a/build_tools/clarch/larch/profiles/i686-testing-local/rootoverlay/etc/rc.local +++ b/build_tools/clarch/larch/profiles/i686-testing-local/rootoverlay/etc/rc.local @@ -5,13 +5,53 @@ . /etc/profile . ${MV_ROOT}/bin/install_functions.sh +function mysql_check { + mysql -e "show databases;" 2>/dev/null >/dev/null + return $? +} + +function mythconverg_check { + mysql mythconverg -e "describe settings;" 2>/dev/null >/dev/null + return $? +} + +function install_db { + pacman --noconfirm -R mythdb-initial 2>/dev/null > /dev/null + pacman -S --noconfirm mythdb-initial 2>/dev/null > /dev/null +} + + #check network parms init_network +#check to see if mysql is running +ATTEMPT=0 +mysql_check && install_db +mythconverg_check +status=$? +while [ ! $status = 0 ] +do + ((ATTEMPT=ATTEMPT+1)) + /etc/rc.d/mysqld stop + sleep 2 + /etc/rc.d/mysqld start + mysqlstatus=$? + if [ $mysqlstatus = 0 ] + then + mysql_check && install_db + mythconverg_check + status=$? + fi + if [ $ATTEMPT = 20 ] + then + echo "Could not start mysql or install mythconverg within 20 attempts" + echo "Aborting install" + exit 20 + fi +done + -#install initial database -pacman -S --noconfirm mythdb-initial 2>/dev/null #search for remote init_remote @@ -26,7 +66,7 @@ else fi -# Set up automatically logged in user (larch live system only) +# Set up automatically logged in user if [ -f /.livesys/autologin ]; then cp /.livesys/autologin /tmp/newuser fi |