Unraid-SlackPack/plugins/ungit.plg

138 lines
3.4 KiB
Plaintext
Raw Normal View History

2016-11-06 14:03:59 +00:00
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
2016-11-12 19:22:18 +00:00
<!ENTITY name "ungit">
2016-11-06 14:03:59 +00:00
<!ENTITY author "dmacias72">
2016-11-12 19:30:43 +00:00
<!ENTITY version "2016.11.06">
2016-11-06 14:03:59 +00:00
<!ENTITY launch "Settings/UnGit">
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/unRAID-plugins/master">
<!ENTITY pluginURL "&gitURL;/plugins/&name;.plg">
<!ENTITY pkgURL "&gitURL;/source/packages">
<!ENTITY plgPATH "/boot/config/plugins/&name;">
2016-11-12 18:53:20 +00:00
<!ENTITY pkgNAME "&name;-&version;-x86_64-1">
2016-11-06 14:03:59 +00:00
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;" author="&author;" launch="&launch;" version="&version;" pluginURL="&pluginURL;">
<!--
This Plugin installs libvirt wake on lan for unRaid 6.1 All dependencies are installed as needed and is controlable from the webgui.
-->
<CHANGES>
##&name;
###&version;
- initial commit
</CHANGES>
<FILE Name="&plgPATH;/nodejs-4.6.0-x86_64-1_slonly.txz" Min="6.2" Run="upgradepkg --install-new">
<URL>&gitURL;/packages/6.2/nodejs-4.6.0-x86_64-1_slonly.txz</URL>
<MD5>8a7dae6947e415f2dd01bf4d2a57b6f4</MD5>
</FILE>
<FILE Name="&plgPATH;/nodejs-4.2.4-x86_64-1_slack.txz" Min="6.1" Max="6.1.99" Run="upgradepkg --install-new">
<URL>&gitURL;/packages/6.1/nodejs-4.2.4-x86_64-1_slack.txz</URL>
<MD5>7c17ad5a7aab095c9dbfe54051772ded</MD5>
</FILE>
<FILE Name="&plgPATH;/&name;.cfg">
<INLINE>
<![CDATA[
DAEMON="disable"
2016-11-06 18:29:48 +00:00
PORT="8448"
2016-11-06 14:03:59 +00:00
]]>
</INLINE>
</FILE>
<!--
The 'plugin' package file.
-->
2016-11-12 18:53:20 +00:00
<FILE Name="&plgPATH;/&pkgNAME;.txz">
<URL>&gitURL;/archive/&pkgNAME;.txz</URL>
2016-11-06 14:03:59 +00:00
</FILE>
<!--
The 'plugin' package MD5 hash.
-->
2016-11-12 18:53:20 +00:00
<FILE Name="&plgPATH;/&pkgNAME;.md5">
<URL>&gitURL;/archive/&pkgNAME;.md5</URL>
2016-11-06 14:03:59 +00:00
</FILE>
<!--
The 'install' script.
-->
<FILE Run="/bin/bash">
<INLINE>
#Verify unRAID Version
source /etc/unraid-version
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-11-12 18:53:20 +00:00
sum1=$(/usr/bin/md5sum &plgPATH;/&pkgNAME;.txz)
sum2=$(/usr/bin/cat &plgPATH;/&pkgNAME;.md5)
2016-11-06 14:03:59 +00:00
if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then
echo "Wrong 'plugin' package md5 hash."
2016-11-12 18:53:20 +00:00
rm &plgPATH;/&pkgNAME;.txz
rm &plgPATH;/&pkgNAME;.md5
2016-11-06 14:03:59 +00:00
exit 1
else
2016-11-12 18:53:20 +00:00
upgradepkg --install-new &plgPATH;/&pkgNAME;.txz
2016-11-06 14:03:59 +00:00
2016-11-12 20:08:02 +00:00
echo "installing ungit (takes a minute)..."
npm -g install ungit
2016-11-06 14:03:59 +00:00
#restart event daemon
echo "starting ungit..."
2016-11-06 22:23:02 +00:00
at -M -f &emhttp;/scripts/restart now 2>/dev/null
2016-11-06 14:03:59 +00:00
# Cleaning old source files
2016-11-12 19:30:43 +00:00
find &plgPATH;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete
find &plgPATH;/ -type f -iname "&name;*.md5" ! -iname "*&version;*" -delete
2016-11-06 14:03:59 +00:00
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been installed."
echo " This plugin requires Dynamix webGui to operate"
echo " Copyright 2016, &author;"
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
fi
</INLINE>
</FILE>
<!--
The 'remove' script.
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
2016-11-06 22:49:23 +00:00
# stop service
echo "stopping ungit..."
at -M -f &emhttp;/scripts/stop now 2>/dev/null
2016-11-12 19:30:43 +00:00
removepkg &plgPATH;/&pkgNAME;.txz
2016-11-06 14:03:59 +00:00
rm -rf &emhttp;
rm -f &plgPATH;/*.txz \
&plgPATH;/*.md5
2016-11-12 20:08:02 +00:00
echo "removing ungit..."
npm -g uninstall ungit
2016-11-06 22:05:52 +00:00
2016-11-06 14:03:59 +00:00
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been removed."
echo " Copyright 2016, &author;"
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
</INLINE>
</FILE>
</PLUGIN>