@JL3,
hier das psg,
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch Automation Pro |
| PseudoGeräte-Script RaspberryPI |
| =============================================================== |
| Smartphone sashelper |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
# In der folgenden Datei sind die Variablen der sashelper mit Pfadangaben
# benannt, wie z. B.:
# $helperurlpi='http://192.168.123.123/sensorandswitch/sensorandswitchhelper.php';
include "conf/sensorandswitchhelperurl.phpconf";
include __DIR__."/../include/psg.php";
/* include "include/includedateien.php";
include "include/includefunctions.php";
include "include/includeconf.php";
include "include/includeconfig.php";
include "include/includedefine.php";
*/
$geraet="MI2SC-Benne"; # ändern
$befehl='sudo ping -w 2 '.$geraet;
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Status=web($url,$post);
$on=substr($Status,strpos($Status,"transmitted,")+12)*1;
if ($on!=0) {
echo "S#1#";
}
else {
echo "S#0#";
}
exit;
?>