Unraid-SlackPack/plugins/libvirtwol.plg

214 lines
5.9 KiB
Plaintext
Raw Normal View History

2015-12-21 07:10:05 +00:00
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "libvirtwol">
<!ENTITY author "dmacias72">
2016-10-15 16:34:42 +00:00
<!ENTITY version "2016.10.15">
2016-03-12 17:45:54 +00:00
<!ENTITY launch "Settings/VMSettings">
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/unRAID-plugins/master">
<!ENTITY pluginURL "&gitURL;/plugins/&name;.plg">
2016-09-16 20:39:44 +00:00
<!ENTITY pkgURL "&gitURL;/source/packages">
2016-10-15 16:34:42 +00:00
<!ENTITY plgPATH "/boot/config/plugins/&name;">
<!ENTITY plgNAME "&name;-&version;-x86_64-1">
2016-09-16 20:39:44 +00:00
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
2015-12-21 07:10:05 +00:00
]>
<PLUGIN name="&name;" author="&author;" launch="&launch;" version="&version;" pluginURL="&pluginURL;">
2015-12-21 07:10:05 +00:00
<!--
This Plugin installs libvirt wake on lan for unRaid 6.1 All dependencies are installed as needed and is controlable from the webgui.
-->
<CHANGES>
2016-10-15 16:34:42 +00:00
###2016.10.15
- add: min and max versions
2016-10-09 23:41:46 +00:00
###2016.10.09
- update for 6.3
2016-09-16 16:34:03 +00:00
###2016.09.16
- update python to 2.7.12
2016-06-04 12:40:16 +00:00
###2016.06.04
- add rc script
2016-06-04 12:43:26 +00:00
- amend dynamix plugin api
2016-04-16 20:10:20 +00:00
###2016.04.16
2016-04-16 21:20:39 +00:00
- add help button comments
2016-04-16 20:19:32 +00:00
- add dynamix plugin API
- add white-space: normal to fix status css formatting
###2016.03.23
2016-03-23 09:13:06 +00:00
- remove libpcap
2016-03-19 15:57:54 +00:00
###2016.03.19
- add wake on lan to advanced view
2016-03-14 06:35:32 +00:00
###2016.03.14
- update package locations
2016-03-12 17:45:54 +00:00
###2016.03.12
- add dual package support for 6.1 and 6.2+
- add python 2.7.11 for 6.2+
- add libvirt python 1.3.1 for 6.2+
- move settings to php file and include in vm settings
- move all permissions on scripts to plugin package install
2016-01-22 19:11:06 +00:00
###2016.01.22
- update install and remove scripts
- check if config exists
- create a default config file
2016-01-03 00:16:54 +00:00
###2016.01.02
- fix not starting with array
2015-12-21 08:36:26 +00:00
###2015.12.21a
- fix config file and start/stop
- add unRAID version check
- add md5 package ckeck
- convert install and remove scripts
2015-12-21 07:10:05 +00:00
###2015.12.01
- added fix for other packet sizes
###2015.11.18
- update python to 2.7.9
###2015.11.17
- fix start and stop event permissions
###2015.11.16
2016-09-16 20:39:44 +00:00
- added promiscuous mode to listen for all packets
2015-12-21 07:10:05 +00:00
- will recieve all ether proto 0x0842 packets now
###2015.11.15
- added support for ethertype 0x0842
- tested with ether-wake but asus router still not waking
###2015.11.14c
- fix plugin page image and link
- pkg variable typo
###2015.11.14
- initial commit
</CHANGES>
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/python-2.7.12-x86_64-1.txz" Min="6.2" Run="upgradepkg --install-new">
<URL>&gitURL;/packages/6.2/python-2.7.12-x86_64-1.txz</URL>
<MD5>a94235dba17e63e12eb888cba9bbb155</MD5>
</FILE>
2015-12-21 07:10:05 +00:00
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/python-2.7.9-x86_64-1.txz" Max="6.1" Run="upgradepkg --install-new">
2016-03-14 06:35:32 +00:00
<URL>&gitURL;/packages/6.1/python-2.7.9-x86_64-1.txz</URL>
2015-12-21 07:10:05 +00:00
<MD5>7d5f6d12757c59e5f08ca25bd63aab78</MD5>
</FILE>
2016-03-12 17:45:54 +00:00
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/libvirt-python-1.3.1-x86_64-1ponce.txz" Min="6.2" Run="upgradepkg --install-new">
<URL>&pkgURL;/libvirt-python-1.3.1-x86_64-1ponce.txz</URL>
<MD5>9a64e4941dd9c7fa3b9c8bf244c9a2d3</MD5>
2016-03-12 17:45:54 +00:00
</FILE>
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/libvirt-python-1.2.18-x86_64-1ponce.txz" Max="6.1" Run="upgradepkg --install-new">
2015-12-21 07:41:20 +00:00
<URL>&pkgURL;/libvirt-python-1.2.18-x86_64-1ponce.txz</URL>
2015-12-21 07:10:05 +00:00
<MD5>4198c7784a57d7ff80fb1d53811ceb5e</MD5>
</FILE>
2016-03-12 17:45:54 +00:00
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/pylibpcap-0.6.2-x86_64-1_slack.txz" Min="6.1" Run="upgradepkg --install-new">
2015-12-21 07:41:20 +00:00
<URL>&pkgURL;/pylibpcap-0.6.2-x86_64-1_slack.txz</URL>
2015-12-21 07:10:05 +00:00
<MD5>2531f44126b3c05d76782c9eedba9988</MD5>
</FILE>
2016-01-22 19:11:06 +00:00
<FILE Name="/boot/config/domain.cfg">
<INLINE>
<![CDATA[
WOL="disable"
]]>
</INLINE>
</FILE>
2015-12-21 07:10:05 +00:00
<!--
The 'plugin' package file.
2015-12-21 07:10:05 +00:00
-->
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/&plgNAME;.txz">
<URL>&gitURL;/archive/&plgNAME;.txz</URL>
</FILE>
<!--
The 'plugin' package MD5 hash.
-->
2016-10-15 16:34:42 +00:00
<FILE Name="&plgPATH;/&plgNAME;.md5">
<URL>&gitURL;/archive/&plgNAME;.md5</URL>
2015-12-21 07:10:05 +00:00
</FILE>
<!--
The 'install' script.
-->
<FILE Run="/bin/bash">
2016-09-16 20:39:44 +00:00
<INLINE>
#Verify unRAID Version
source /etc/unraid-version
2016-03-14 06:35:32 +00:00
VER=${version:0:3}
if [[ $VER == 6.0 ]]; then
echo "unRAID version 6.1 or higher is required"
exit 1
fi
# Verify and install plugin package
2016-10-15 16:34:42 +00:00
sum1=$(/usr/bin/md5sum &plgPATH;/&plgNAME;.txz)
sum2=$(/usr/bin/cat &plgPATH;/&plgNAME;.md5)
if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then
echo "Wrong 'plugin' package md5 hash."
2016-10-15 16:34:42 +00:00
rm &plgPATH;/&plgNAME;.txz
rm &plgPATH;/&plgNAME;.md5
exit 1
else
2016-09-16 20:39:44 +00:00
if [[ $VER == 6.2 ]]; then
# restore VM Manager Menu
sed -i -- 's/VMManager:1/OtherSettings/g' /usr/local/emhttp/plugins/dynamix.vm.manager/VMSettings.page
fi
2016-10-09 23:41:46 +00:00
if [[ $VER == 6.3 ]]; then
2016-10-15 16:34:42 +00:00
# restore VM Manager Menu
sed -i -- 's/VMManager:1/OtherSettings/g' /usr/local/emhttp/plugins/dynamix.vm.manager/VMSettings.page
2016-10-09 23:41:46 +00:00
fi
2016-10-15 16:34:42 +00:00
upgradepkg --install-new &plgPATH;/&plgNAME;.txz
2016-09-16 20:39:44 +00:00
#restart event daemon
<![CDATA[
/usr/local/emhttp/plugins/libvirtwol/scripts/stop >/dev/null 2>&1 < /dev/null &
sleep 1
echo "starting libvirtwol..."
setsid /usr/local/emhttp/plugins/libvirtwol/scripts/start >/dev/null 2>&1 < /dev/null &
]]>
# Cleaning old source files
2016-10-15 16:34:42 +00:00
find &plgPATH;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete
find &plgPATH;/ -type f -iname "&name;*.md5" ! -iname "*&version;*" -delete
2015-12-21 07:10:05 +00:00
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been installed."
echo " This plugin requires Dynamix webGui to operate"
2016-01-10 10:20:03 +00:00
echo " Copyright 2016, &author;"
2015-12-21 07:10:05 +00:00
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
2016-03-25 04:55:35 +00:00
2016-03-12 17:45:54 +00:00
fi
2015-12-21 07:10:05 +00:00
</INLINE>
</FILE>
<!--
The 'remove' script.
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
&emhttp;/scripts/stop
2016-10-15 16:34:42 +00:00
removepkg &plgPATH;/&plgNAME;.txz
rm -rf &emhttp;
2016-10-15 16:34:42 +00:00
rm -f &plgPATH;/&plgNAME;.txz
rm -f &plgPATH;/&plgNAME;.md5
2016-01-22 19:11:06 +00:00
#remove installed packages
2016-10-15 16:34:42 +00:00
rm -f &plgPATH;/libpcap*.txz
removepkg &plgPATH;/*.txz
rm -f &plgPATH;/*.txz
2016-01-22 19:11:06 +00:00
# restore VM Manager Menu
2016-03-12 17:45:54 +00:00
#sed -i -- 's/VMManager:1/OtherSettings/g' /usr/local/emhttp/plugins/dynamix.vm.manager/VMSettings.page
2015-12-21 07:10:05 +00:00
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been removed."
2016-01-10 10:20:03 +00:00
echo " Copyright 2016, &author;"
2015-12-21 07:10:05 +00:00
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
</INLINE>
</FILE>
</PLUGIN>