Пример #1
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
try {
    require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';
    include_file('core', 'authentification', 'php');
    include_file('core', 'pin', 'config', 'arduidom');
    if (!isConnect('admin')) {
        throw new Exception(__('401 - Accès non autorisé', __FILE__));
    }
    if (init('action') == 'startDaemon') {
        if (arduidom::deamon_start(true)) {
            ajax::success();
        } else {
            ajax::error("Le démon n'a pas démarré !");
        }
    }
    if (init('action') == 'bt_Prerequis') {
        arduidom::dependancy_install();
        ajax::success();
    }
    if (init('action') == 'stopDaemon') {
        if (arduidom::deamon_stop()) {
            ajax::success();
        } else {
            ajax::error("Le démon n'a pas été stoppé !");
        }