// Change wd to this files location include_once "../main/includes/config.inc.php"; include_once "../main/includes/functions.php"; run_location_tracker(); // Have servers moved if moved update configuration print "\n"; //=== If no parameters passed use defaults from config.inc.php if ($argc == 2) { // Was a parameter passed $information = $argv[1]; // yes: } else { exit; // no: Give up } $mysql_port = get_mysql_port(); $apache_port = get_apache_port(); $ssl_port = get_apache_ssl_port(); //=== Display Admin Panel in browser ========================================== if ($information == 1) { $command = "start http://localhost:{$apache_port}/apanel/"; // display index page exec($command, $dummy, $return); // run command exit; } //=== Display phpMyAdmin in browser ========================================== if ($information == 2) { $command = "start http://localhost:{$apache_port}/apanel/phpmyadmin/"; // display index page exec($command, $dummy, $return);
print " Apache SSL port = " . get_apache_ssl_port() . " In use by this server\n"; } if (!apache_running() && get_apache_tracker() != "free" && ssl_enabled()) { print " Apache SSL port = " . get_apache_ssl_port() . " Undefined!\n"; } if (!apache_running() && get_apache_tracker() != "free" && !ssl_enabled()) { print " Apache SSL port = " . get_apache_ssl_port() . " Undefined!\n"; } if (apache_running() && get_apache_tracker() != "free" && !ssl_enabled()) { print " Apache SSL port = " . get_apache_ssl_port() . " SSL Not enabled free to use\n"; } if (port_in_use(get_apache_ssl_port()) && get_apache_tracker() == "free") { print " Apache SSL port = " . get_apache_ssl_port() . " In use by another program.\n"; } if (!port_in_use(get_apache_ssl_port()) && get_apache_tracker() == "free") { print " Apache SSL port = " . get_apache_ssl_port() . " Is free to use\n"; } //=== MySQL port if (mysql_running() && get_mysql_tracker() != "free") { print " MySQL port = " . get_mysql_port() . " In use by this server\n"; } if (!mysql_running() && get_mysql_tracker() != "free") { print " MySQL port = " . get_mysql_port() . " Undefined!\n"; } if (port_in_use(get_mysql_port()) && get_mysql_tracker() == "free") { print " MySQL port = " . get_mysql_port() . " In use by another program.\n"; } if (!port_in_use(get_mysql_port()) && get_mysql_tracker() == "free") { print " MySQL port = " . get_mysql_port() . " Is free to use.\n"; } print "\n\n";
function stop_mysql() { // Global variables for paths and files global $usf_uniserv; global $us_mysql_bin; $mysql_password = get_mysql_password(); // Get password $mysql_port = get_mysql_port(); // Get port $cmd1 = "start "; $cmd2 = "{$usf_uniserv} \""; $cmd3 = "{$us_mysql_bin}/mysqladmin.exe --port={$mysql_port} --user=root --password={$mysql_password} shutdown\""; $cmd = $cmd1 . $cmd2 . $cmd3; //print $cmd; // Test code exec($cmd, $dummy, $return); // Run command set_mysql_tracker('free'); // Set tracker free. }
// Have servers moved if moved update configuration print "\n"; //=== Get Configuration $file = "db_backup.ini"; $ini_array = parse_ini_file($file); // Read db_backup.ini into array $FIFO = $ini_array['Fifo']; // Number of archives to save $BACKUP_NAME = $ini_array['Archive_name'] . date('Y-m-d-H-i-s'); //File+time $EXCLUDES = $ini_array['Excludes']; // Assign array to exclude array //=== Mysql connection settings $MYSQL_HOST = 'localhost'; // Default on 3306 $MYSQL_PORT = get_mysql_port(); // Default 3306 User Changeable $MYSQL_USER = '******'; // root user can access all DBs $MYSQL_PASSWD = get_mysql_password(); // Default root User Changeable //=== Set path variables $DB_BASE = "{$base_f}/db_backup"; // Main archive folder $DEST = "{$DB_BASE}/archive"; // Destiation for final archived dbs $log_file = "{$DB_BASE}/log.txt"; // Log file $TEMP = "{$base_f}/tmp/backup_temp"; // Temp location for archive creation //== Check MySQL is running
if ($Apache_ssl_port == $avoid1 || $Apache_ssl_port == $avoid2) { $Apache_ssl_port = $Apache_ssl_port + 1; } $Apache_name_old = get_apache_exe(); # Apache executable name # New Apache executable name if (preg_match("/([a-zA-Z]+)(\\d*)(\\.exe)/", $Apache_name_old, $matches)) { $Apache_name = $matches[1] . ($matches[2] + 1) . $matches[3]; } $Apache_service_name_old = $us_apache_service_name; # Apache original service name # Apache New service name if (preg_match("/([a-zA-Z]+)(\\d*)/", $Apache_service_name_old, $matches)) { $Apache_service_name = $matches[1] . ($matches[2] + 1); } $MySQL_port_old = get_mysql_port(); # Server port $MySQL_port = $MySQL_port_old + 1; # New Server port # Avoid these ports if ($MySQL_port == $avoid1 || $MySQL_port == $avoid2) { $MySQL_port = $MySQL_port + 1; } $MySQL_name_old = get_mysql_exe(); # MySQL executable name # New MYSQL executable name if (preg_match("/([a-zA-Z\\-]+)(\\d*)(\\.exe)/", $MySQL_name_old, $matches)) { $MySQL_name = $matches[1] . ($matches[2] + 1) . $matches[3]; } $MySQL_service_name_old = $us_mysql_service_name; # MySQL original service name