mirror of
https://github.com/hak5/nano-tetra-modules.git
synced 2025-10-29 16:58:09 +00:00
Removed .gitignore files and changed code to create directories
This commit is contained in:
@@ -54,6 +54,9 @@ class Papers extends Module
|
||||
{
|
||||
public function route() {
|
||||
switch ($this->request->action) {
|
||||
case 'init':
|
||||
$this->init();
|
||||
break;
|
||||
case 'checkDepends':
|
||||
$this->checkDepends();
|
||||
break;
|
||||
@@ -104,6 +107,38 @@ class Papers extends Module
|
||||
break;
|
||||
}
|
||||
}
|
||||
private function init() {
|
||||
if (!file_exists(__LOGS__)) {
|
||||
if (!mkdir(__LOGS__, 0755, true)) {
|
||||
$this->respond(false, "Failed to create logs directory");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_exists(__DOWNLOAD__)) {
|
||||
if (!mkdir(__DOWNLOAD__, 0755, true)) {
|
||||
Papers::logError("Failed init", "Failed to initialize because the 'download' directory structure could not be created");
|
||||
$this->respond(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_exists(__SSLSTORE__)) {
|
||||
if (!mkdir(__SSLSTORE__, 0755, true)) {
|
||||
Papers::logError("Failed init", "Failed to initialize because the 'ssl store' directory structure could not be created");
|
||||
$this->respond(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_exists(__SSHSTORE__)) {
|
||||
if (!mkdir(__SSHSTORE__, 0755, true)) {
|
||||
Papers::logError("Failed init", "Failed to initialize because the 'ssh store' directory structure could not be created");
|
||||
$this->respond(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
private function checkDepends() {
|
||||
$retData = array();
|
||||
exec(__SCRIPTS__ . "checkDepends.sh", $retData);
|
||||
|
||||
Reference in New Issue
Block a user