0) { $uptimeString .= $days; $uptimeString .= (($days == 1) ? " day" : " days"); } if ($hours > 0) { $uptimeString .= (($days > 0) ? ", " : "") . $hours; $uptimeString .= (($hours == 1) ? " hr" : " hrs"); } if ($mins > 0) { $uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins; $uptimeString .= (($mins == 1) ? " min" : " mins"); } if ($secs > 0) { $uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs; $uptimeString .= (($secs == 1) ? " s" : " s"); } return $uptimeString; } function startsWith($haystack, $needle) { return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false; } function getMHZ($freq) { return substr($freq,0,3) . "." . substr($freq,3,3) . "." . substr($freq,6) . " Mhz"; } function isProcessRunning($processname) { exec("pgrep " . $processname, $pids); if(empty($pids)) { // process not running! return false; } else { // process running! return true; } } function createConfigLines() { $out =""; foreach($_GET as $key=>$val) { if($key != "cmd") { $out .= "define(\"$key\", \"$val\");"."\n"; } } return $out; } function checkSetup() { if (defined(DISTRIBUTION)) { ?>