Skip to content

Commit

Permalink
changed to wittypiutilities.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JavanXD committed Mar 8, 2024
1 parent ae03c97 commit 70ac37a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions backend/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,28 @@ function clean($string) {
file_put_contents($wittyPiFile, $postJson["wittyPi"]["normal"]["schedule"]);

// set WittyPi (dont wait exec to finish)
shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 1 $wittyPi_version > /dev/null 2>&1 &");
//shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 1 $wittyPi_version > /dev/null 2>&1 &");
shell_exec("sudo sh ".$GLOBALS['scriptsFolder']."/wittypiutilities.py 1 > /dev/null 2>&1 &");
} else {

// clear schedule.wpi
emptyFile($wittyPiFile);
$postJson["wittyPi"]["normal"]["enabled"] = false;

// reset wittyPi schedule
shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 0 $wittyPi_version > /dev/null 2>&1 &");
//shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 0 $wittyPi_version > /dev/null 2>&1 &");
shell_exec("sudo sh ".$GLOBALS['scriptsFolder']."/wittypiutilities.py 0 2>&1 &");
}

// set WittyPi dummyload
if ($postJson["wittyPi"]["enabled"] == true && isset($postJson["wittyPi"]["version"]) && isset($postJson["wittyPi"]["dummyload"]) && $postJson["wittyPi"]["version"] >= 3) {
if ((INT)$postJson["wittyPi"]["dummyload"] > 0) {
$dummyload = (INT)$postJson["wittyPi"]["dummyload"];
shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 2 $wittyPi_version $dummyload > /dev/null 2>&1 &");
//shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 2 $wittyPi_version $dummyload > /dev/null 2>&1 &");
shell_exec("sudo sh ".$GLOBALS['scriptsFolder']."/wittypiutilities.py 2 > /dev/null 2>&1 &");
} else {
shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 3 $wittyPi_version > /dev/null 2>&1 &");
//shell_exec("sudo sh ".$GLOBALS['shellDir']."/change_wittypi.sh 3 $wittyPi_version > /dev/null 2>&1 &");
shell_exec("sudo sh ".$GLOBALS['scriptsFolder']."/wittypiutilities.py 2 > /dev/null 2>&1 &");
}
}

Expand Down

0 comments on commit 70ac37a

Please sign in to comment.