function doUpdateExtraStuff() { global $gbl, $sgbl, $login, $ghtml; lxfile_mkdir("__path_program_etc/flag"); convertIpaddressToComa(); print "Fix extra database\n"; fixExtraDB(); print "Set some defaults\n"; db_set_default('vps', 'ttype', 'openvz'); db_set_default('pserver', 'coma_psrole_a', 'vps'); db_set_default("vps", "swapdiskname", "vm.swap", "ttype = 'xen'"); db_set_default("vps", "maindiskname", "root.img", "ttype = 'xen'"); db_set_default('vps', 'corerootdir', '/vz/private', "ttype = 'openvz'"); db_set_default("vps", "corerootdir", "/home/xen", "ttype = 'xen'"); print "Fixing database passwords\n"; $a = null; fix_mysql_root_password('localhost'); $dbadmin = new Dbadmin(null, 'localhost', "mysql___localhost"); $dbadmin->get(); $pass = $dbadmin->dbpassword; $a['mysql']['dbpassword'] = $pass; slave_save_db("dbadmin", $a); print "Fixing OS template permissions\n"; lxfile_unix_chmod_rec("/vz/template/cache/", "0755"); lxfile_unix_chmod_rec("/home/hypervm/xen/template/", "0755"); call_with_flag("dofixParentClname"); print "Check License\n"; passthru("{$sgbl->__path_php_path} htmllib/lbin/getlicense.php"); print "Fix OpenVZ resources\n"; fixOpenVZResource(); print "Move clients to client of needed\n"; move_clients_to_client(); print "create backup dirs\n"; add_vps_backup_dir(); print "Parse SQL Data\n"; parse_sql_data(); print "Fix IP POOL\n"; lxshell_return("__path_php_path", "../bin/fix/fixippool.php"); print "Fix IP adresses in database\n"; fix_ipaddress_column_type(); fix_vmipaddress(); print "Checking HIB template\n"; get_kloxo_ostemplate(); print "Set admin email\n"; save_admin_email(); print "Checking Skin Images\n"; copy_image(); system("mysql -u hypervm -p`cat ../etc/conf/hypervm.pass` hypervm1_0 < ../file/interface/interface_template.dump"); if (lxfile_exists("/etc/init.d/libvirtd")) { print "Make sure libvirtd is not started after reboot\n"; system("chkconfig libvirtd off 2>/dev/null"); } if (is_openvz()) { print "Fixing Base OS templates\n"; if (!lxfile_real("/vz/template/cache/centos-5-i386-afull.tar.gz")) { system("mkdir -p /vz/template/cache/ ; cd /vz/template/cache/ ; rm centos-5-i386-afull.tar.gz; wget download.lxcenter.org/download/openvztemplates/base/centos-5-i386-afull.tar.gz "); system("rm /vz/template/cache/index.html* 2>/dev/null"); } } else { if (!lxfile_real("/home/hypervm/xen/template/centos-5-i386-afull.tar.gz")) { system("mkdir -p /home/hypervm/xen/template ; cd /home/hypervm/xen/template/ ; rm centos-5-i386-afull.tar.gz; wget download.lxcenter.org/download/xentemplates/base/centos-5-i386-afull.tar.gz "); system("rm /home/hypervm/xen/template/index.html* 2>/dev/null"); } } print "Fix SSL\n"; fix_self_ssl(); print "Fix database password\n"; critical_change_db_pass(); print "Delete old repo's\n"; if (lxfile_exists("/etc/yum.repos.d/lxlabs.repo")) { lxfile_mv("/etc/yum.repos.d/lxlabs.repo", "/etc/yum.repos.d/lxlabs.repo.lxsave"); system("rm -f /etc/yum.repos.d/lxlabs.repo"); print "Removed lxlabs.repo\n"; } }
function doUpdates() { global $gbl, $sgbl, $login, $ghtml; createFlagDir(); fixIpAddress(); fixservice(); add_domain_backup_dir(); createOSUserAdmin(); call_with_flag("fix_phpini"); call_with_flag("fix_awstats"); call_with_flag("fix_domainkey"); setWatchdogDefaults(); fixMySQLRootPassword(); save_admin_email(); getKloxoLicenseInfo(); createDatabaseInterfaceTemplate(); fix_self_ssl(); }