<?php

ob_start();
error_reporting(0);
session_start();
include '../includes/Request.php';
include '../includes/String.php';
include 'import.php';
if (!isset($_REQUEST['do'])) {
    die('Hi you !');
}
$do = $_REQUEST['do'];
switch ($do) {
    case 'connect':
        checkConnect();
        break;
    case 'complete':
        startInstall();
        break;
}
function cronjob_exists($command)
{
    $cronjob_exists = false;
    exec('crontab -l', $crontab);
    if (isset($crontab) && is_array($crontab)) {
        $crontab = array_flip($crontab);
        if (isset($crontab[$command])) {
            $cronjob_exists = true;
        }
    }
    return $cronjob_exists;
Beispiel #2
0
}
if (!is_dir("/dev/shm/1090data")) {
    mkdir("/dev/shm/1090data");
}
if (!is_dir("/dev/shm/upload")) {
    mkdir("/dev/shm/upload");
}
if (!is_dir("/dev/shm/cam1")) {
    mkdir("/dev/shm/cam1");
}
while (true) {
    $config = readConfiguration();
    logMessage("Configuration has been read: " . json_encode($config));
    check978Running();
    check1090Running();
    checkMotionRunning();
    while (!checkConnect()) {
        logMessage("No network Connection detected, connecting");
        if (!connect()) {
            logMessage("Connection failed");
        }
    }
    if (!uploadADSB()) {
        logMessage("ADSB Upload failed.");
    }
    getRelaySchedule();
    checkrelaySchedule();
    checkFlags();
    uploadNewPics();
    sleep($config->interactTimer);
}