Updated final install step
This commit is contained in:
parent
4583be981d
commit
5f315abb79
2 changed files with 26 additions and 8 deletions
|
@ -14,18 +14,32 @@ class FinishSetup extends Setup {
|
|||
}
|
||||
|
||||
function runSetup() {
|
||||
if ($this->createAirtimeConfigDirectory()) {
|
||||
$this->moveAirtimeConfig();
|
||||
$message = null;
|
||||
$errors = array();
|
||||
|
||||
if ($this->checkAirtimeConfigDirectory()) {
|
||||
if (!$this->moveAirtimeConfig()) {
|
||||
$message = "Error moving airtime.conf or deleting /tmp/airtime.conf.temp!";
|
||||
$errors[] = "ERR";
|
||||
}
|
||||
} else {
|
||||
$message = "Failed to move airtime.conf; /etc/airtime doesn't exist!";
|
||||
$errors[] = "ERR";
|
||||
}
|
||||
|
||||
return array(
|
||||
"message" => $message,
|
||||
"errors" => $errors,
|
||||
);
|
||||
}
|
||||
|
||||
function createAirtimeConfigDirectory() {
|
||||
return file_exists("/etc/airtime/") ? true
|
||||
: mkdir("/etc/airtime/", 0755, true);
|
||||
function checkAirtimeConfigDirectory() {
|
||||
return file_exists("/etc/airtime/");
|
||||
}
|
||||
|
||||
function moveAirtimeConfig() {
|
||||
return copy(AIRTIME_CONF_TEMP_PATH, "/etc/airtime/airtime.conf");
|
||||
return copy(AIRTIME_CONF_TEMP_PATH, "/etc/airtime/airtime.conf")
|
||||
&& unlink(AIRTIME_CONF_TEMP_PATH);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue