Files
resatennis_tyroltenn/IDrive/.config/index.php

88 lines
2.0 KiB
PHP
Executable File

<?php
#require_once "common.php";
#$configFile = dirname(dirname(__FILE__)) . PATHSEPARATOR . CONFIG . PATHSEPARATOR . CONFIG_FILE;
define('CONFIG','.config');
define('CONFIG_FILE','configure.txt');
define('NETGEAR','netgear');
define('QNAP','QNAP');
define('SYNOLOGY','synology');
define('TWOTIER','twotier');
define('ASUSTOR','Asustor');
$configFile = dirname(__FILE__)."/".CONFIG."/".CONFIG_FILE;
$configFile1 = dirname(__FILE__)."/".CONFIG_FILE;
if (file_exists($configFile)) {
$file = fopen($configFile, 'r');
} elseif(file_exists($configFile1)){
$file = fopen($configFile1, 'r');
}
# break added for indefinite looping
if($file) {
$hash = array();
while(!feof($file)) {
$pair = preg_split ('/\s+/', fgets($file), 2);
$hash[array_shift($pair)] = array_shift($pair);
}
fclose($file);
}
$message = 'IDrive App has been stopped.';
if($hash['machine']) {
$machine = trim($hash['machine']);
#print "#".$machine."#<br><br>";
switch($machine) {
case SYNOLOGY:
$appCenterDetail = 'Package Center';
break;
case QNAP:
$appCenterDetail = 'App Center';
break;
case NETGEAR:
$appCenterDetail = 'Apps';
break;
case ASUSTOR:
$appCenterDetail = 'App Central';
break;
}
$message = 'IDrive App has been stopped in '.ucfirst($machine).' '.$appCenterDetail;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="IDrive" content="service_not_available" />
<title>IDrive <?php if($machine) print ucfirst($machine)." "; ?>Backup App</title>
</head>
<style type="text/css">
<!--
h1 {
font-family: Arial, Helvetica, sans-serif;
color: #0066CC;
font-size: 25px;
line-height: 60px;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
-->
</style>
<body>
<center>
<br><br><br><br>
<h1><?php print $message; ?></h1>
<br><br>
</center>
</body>
</html>