function unitray_running() { global $usf_pskill; // pskill program $UniTray_exe = get_unitray_exe(); // get program name ; $cmd = "{$usf_pskill} {$UniTray_exe}"; // command line to be run exec($cmd, $dummy, $return); // 0=running 1=not-running if ($return == 0) { // Check return value return true; // UniTray is running } else { return false; // UniTray not running } }
$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 # MySQL service name if (preg_match("/([a-zA-Z]+)(\\d*)/", $MySQL_service_name_old, $matches)) { $MySQL_service_name = $matches[1] . ($matches[2] + 1); } // UniTray $UniTray_name_old = get_unitray_exe(); # UniTray executable name # New UniTray executable name if (preg_match("/([a-zA-Z]+)(\\d*)(\\.exe)/", $UniTray_name_old, $matches)) { $UniTray_name = $matches[1] . ($matches[2] + 1) . $matches[3]; } $old_id = $matches[2]; // General reference #== Get user inputs ============================================================================================ #== Get user inputs $Apache_port = prompt_user(" Current Apache port = {$Apache_port_old} Proposed port ", $Apache_port); // Avoid these ports if ($Apache_port == $avoid1 || $Apache_port == $avoid2) { print "\n == Note: You cannot use ports {$avoid1} or {$avoid2}!\n Please enter a new value\n\n"; while ($Apache_port == $avoid1 || $Apache_port == $avoid2) { $Apache_port = prompt_user(" Current Apache port = {$Apache_port_old} Proposed port ", $Apache_port + 1);