Unraid-SlackPack/plugins/speedtest.plg

130 lines
3.7 KiB
Plaintext
Raw Normal View History

2015-12-11 03:54:56 +00:00
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "speedtest">
<!ENTITY repo "unRAID">
<!ENTITY author "dmacias72">
2015-12-11 04:19:45 +00:00
<!ENTITY version "2015.12.10a">
2015-12-11 03:54:56 +00:00
<!ENTITY launch "Settings/&name;">
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/&repo;/master">
<!ENTITY pluginURL "&gitURL;/plugins/&name;.plg">
<!ENTITY pkgURL "&gitURL;/source/packages">
2015-12-11 04:02:10 +00:00
<!ENTITY pkgs "/boot/packages">
2015-12-11 03:54:56 +00:00
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;" author="&author;" launch="&launch;" version="&version;" pluginURL="&pluginURL;">
<!--
This Plugin installs speedtest-cli for unRaid 6.1 All dependencies are installed as needed and is controlable from the webgui.
-->
<CHANGES>
###2015.12.10
- add date and time to table
- add switchbuttons
- update packages
###2015.10.19
- typos
###2015.10.18b
- update to python 2.7.9
###2015.10.18a
- update install script
###2015.10.17
- initial commit
</CHANGES>
<FILE Name="/boot/config/plugins/NerdPack/packages/python-2.7.9-x86_64-1.txz" Run="/sbin/upgradepkg --install-new">
<URL>https://raw.githubusercontent.com/eschultz/unraid6-nerdpack/master/packages/python-2.7.9-x86_64-1.txz</URL>
<MD5>7d5f6d12757c59e5f08ca25bd63aab78</MD5>
</FILE>
<FILE Name="&pkgs;/pyOpenSSL-0.15.1-x86_64-1_slack.txz" Run="/sbin/upgradepkg --install-new">
2015-12-11 04:03:32 +00:00
<URL>&pkgURL;/pyOpenSSL-0.15.1-x86_64-1_slack.txz</URL>
2015-12-11 03:54:56 +00:00
<MD5>b422874df919df6baa10774bd2ddc2cc</MD5>
</FILE>
<FILE Name="&pkgs;/pysetuptools-18.2-x86_64-2_slack.txz" Run="/sbin/upgradepkg --install-new">
2015-12-11 04:03:32 +00:00
<URL>&pkgURL;/pysetuptools-18.2-x86_64-2_slack.txz</URL>
2015-12-11 03:54:56 +00:00
<MD5>8cb67f040f55b152042752c85b8c68d6</MD5>
</FILE>
<FILE Name="&pkgs;/pip-7.1.2-x86_64-1_slack.txz" Run="/sbin/upgradepkg --install-new">
2015-12-11 04:03:32 +00:00
<URL>&pkgURL;/pip-7.1.2-x86_64-1_slack.txz</URL>
2015-12-11 03:54:56 +00:00
<MD5>1e0a8d9e281cd075c175eca86aea2130</MD5>
</FILE>
<!--
The 'plugin' package file.
-->
<FILE Name="&plugin;/&name;-&version;.txz">
2015-12-11 04:15:10 +00:00
<URL>&gitURL;/archive/&name;-&version;.txz</URL>
2015-12-11 03:54:56 +00:00
</FILE>
<!--
The 'plugin' package MD5 hash.
-->
<FILE Name="&plugin;/&name;-&version;.md5">
2015-12-11 04:15:10 +00:00
<URL>&gitURL;/archive/&name;-&version;.md5</URL>
2015-12-11 03:54:56 +00:00
</FILE>
<!--
The 'install' script.
-->
<FILE Run="/bin/bash">
<INLINE>
# Verify and install plugin package
sum1=$(/usr/bin/md5sum &plugin;/&name;-&version;.txz)
sum2=$(/usr/bin/cat &plugin;/&name;-&version;.md5)
if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then
echo "Wrong 'plugin' package md5 hash."
2015-12-11 04:15:10 +00:00
rm &plugin;/&name;-&version;.txz
rm &plugin;/&name;-&version;.md5
2015-12-11 03:54:56 +00:00
exit 1
else
upgradepkg --install-new &plugin;/&name;-&version;.txz
fi
# Create symlink to xml on flash drive
ln -sf &plugin;/&name;.xml &emhttp;/&name;.xml
#upgrade pip and install speedtest-cli
pip install --upgrade pip
pip install speedtest-cli
pip install --upgrade speedtest-cli
# Cleaning old source files
find /boot/config/plugins/&name;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete
find /boot/config/plugins/&name;/ -type f -iname "&name;*.md5" ! -iname "*&version;*" -delete
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been installed."
echo " This plugin requires Dynamix webGui to operate"
echo " Copyright 2015, &author;"
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
</INLINE>
</FILE>
<!--
The 'remove' script.
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
removepkg &plugin;/&name;-&version;.txz
rm -f &plugin;/&name;-&version;.txz
rm -f &plugin;/*.txz
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been removed."
echo " Copyright 2015, &author;"
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
</INLINE>
</FILE>
</PLUGIN>