summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/install_db_chroot.sh
blob: 272b5569e8e8a6f088a6baa4fe42b6040afc6dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
. /etc/profile
. /etc/systemconfig


myhost=$hostname
hostname $myhost
echo $myhost > /etc/hostname
echo "install_db_chroot hostname is $hostname"

. $MV_ROOT/bin/install_functions.sh
#myhost=`cat /etc/hostname`

#mount -t proc none /proc
pacman --noconfirm -Sf mysql
/etc/rc.d/mysqld

status=1
mysqlstatus=1
while [ ! $status = 0  ]
do
    /etc/rc.d/mysqld stop
    sleep 1
    /etc/rc.d/mysqld start
    mysqlstatus=$?
    if [ $mysqlstatus = 0 ]
    then
   	mysql -e "show databases;"
        showstatus=$?
        if [ $showstatus = 0 ]
        then
            pacman --noconfirm -R mythdb-initial
            pacman --noconfirm  -S mythdb-initial

            #This piece only populates the distro_default tables
            #save off distro_default
            $MV_ROOT/bin/myth_settings_wrapper.sh -c save-default

            #load default into distro_default tables
            $MV_ROOT/bin/myth_settings_wrapper.sh -c load

            $MV_ROOT/bin/myth_settings_wrapper.sh -c restore -t syssettings
            $MV_ROOT/bin/systemconfig.sh misc,hostype,this_is_install

            update_db_settings HostServiceMythWEB "1"
            echo 'UseMythWEB="1"' >> /etc/systemconfig

            #update database to allow user jobs on this host.
            $MV_ROOT/bin/myth_settings_wrapper.sh  -c  USERJOBALLOW
            $MV_ROOT/bin/myth_settings_wrapper.sh  -c  ACCESSCONTROL
	   if [ -d /data/srv/mysql/mythconverg ]
	   #if [ -d /var/lib/mysql/mythconverg ]
	   then
   	     # pacman --noconfirm -R webcalendar
         #   pacman --noconfirm --nodeps  -S webcalendar
	    status=0
	   fi
#        if [ $SystemType = "Master_backend" ]
#        then
#             $MV_ROOT/bin/myth_settings_wrapper.sh  -c  BECONFIG  -s master  -a $dbhost
#        fi
   	fi
    fi
done
/etc/rc.d/mysqld stop
#umount /proc