Skip to content

Commit

Permalink
Support a usr script
Browse files Browse the repository at this point in the history
  • Loading branch information
Squidly271 committed Mar 14, 2017
1 parent 255e892 commit badfc85
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
Binary file removed archive/ca.turbo-2017.03.12-x86_64-1.txz
Binary file not shown.
Binary file added archive/ca.turbo-2017.03.14-x86_64-1.txz
Binary file not shown.
7 changes: 5 additions & 2 deletions plugins/ca.turbo.plg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "ca.turbo">
<!ENTITY author "Andrew Zawadzki">
<!ENTITY version "2017.03.12a">
<!ENTITY md5 "9d038852fb57b98e33ed1fee8bc82bd9">
<!ENTITY version "2017.03.14">
<!ENTITY md5 "3b8ce48ec914c925ca9b6898dd5dfd43">
<!ENTITY launch "Settings/Turbo">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "Squidly271/ca.turbo">
Expand All @@ -13,6 +13,9 @@
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;">

<CHANGES>
###2017.03.14
- Support a user script to force modes on a schedule (see support thread)

###2017.03.12a
- Fix minor display aberration

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/include/exec.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,26 @@
echo "Settings Updated";
break;
case 'status':
if ( is_file($turboPaths['backgroundPID']) ) {
$status = readJsonFile($turboPaths['status']);
}
if ( ! $status ) {
$status = readJsonFile($turboPaths['status']);
if ( (! is_file($turboPaths['backgroundPID']) ) && (! $status['override'] ) ) {
$unRaidVars = parse_ini_file("/var/local/emhttp/var.ini");
if ($unRaidVars['md_write_method'] == "1") {
$status['mode'] = "turbo";
}
}
$spunDown = ( $status ) ? $status['spundown'] : "<font color=red>Script Not Running</font>";

$o = "<script>";
$o .= " $('#spunDown').html('$spunDown');";
$msg = ($status['mode'] == "turbo") ? "Turbo (Reconstruct Write)" : "Normal (Read/Modify/Write)";

if ( $status['override'] ) {
$msg .= " Autoscript overridden";
}
if ( (! is_file($turboPaths['backgroundPID']) ) && (! $status['override'] ) ) {
$msg = "unRaid Determined";
}

$o .= " $('#turboOn').html('$msg');";
if ( is_file($turboPaths['backgroundPID']) ) {
$o .= " $('#running').html('<font color=green>Running</font>');";
Expand Down

0 comments on commit badfc85

Please sign in to comment.