fix: delete git package on remove

This commit is contained in:
Derek Macias 2016-02-06 10:09:24 -07:00
parent 817745c3c9
commit c84f49d8b8

View File

@ -6,10 +6,11 @@
<!ENTITY version "2016.02.06"> <!ENTITY version "2016.02.06">
<!ENTITY launch "Settings/Aesir"> <!ENTITY launch "Settings/Aesir">
<!ENTITY gitURL "https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master"> <!ENTITY gitURL "https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master">
<!ENTITY gitTAR "aesir-master.tar.gz">
<!ENTITY pluginURL "&gitURL;/plugins/&name;.plg"> <!ENTITY pluginURL "&gitURL;/plugins/&name;.plg">
<!ENTITY pkgURL "&gitURL;/source/packages"> <!ENTITY pkgURL "&gitURL;/source/packages">
<!ENTITY plgpath "/boot/config/plugins/&name;"> <!ENTITY plgPATH "/boot/config/plugins/&name;">
<!ENTITY plgname "&name;-&version;-x86_64-1"> <!ENTITY plgNAME "&name;-&version;-x86_64-1">
<!ENTITY http "/srv/www/Aesir"> <!ENTITY http "/srv/www/Aesir">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;"> <!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]> ]>
@ -22,6 +23,7 @@ This Plugin installs and controls Aesir webGUI for unRaid 6.1+ All dependencies
<CHANGES> <CHANGES>
###2016.02.06 ###2016.02.06
- fix events not executable
- fix dockers not visible when running other than root - fix dockers not visible when running other than root
- remove user selection - remove user selection
###2016.02.05 ###2016.02.05
@ -32,17 +34,17 @@ This Plugin installs and controls Aesir webGUI for unRaid 6.1+ All dependencies
<!-- <!--
git from github as tarball git from github as tarball
--> -->
<FILE Name="&plgpath;/aesir-master.tar.gz"> <FILE Name="&plgPATH;/&gitTAR">
<URL>"https://api.github.com/repos/linuxserver/Aesir/tarball/master"</URL> <URL>"https://api.github.com/repos/linuxserver/Aesir/tarball/master"</URL>
</FILE> </FILE>
<FILE Name="&plgpath;/&name;.cfg"> <FILE Name="&plgPATH;/&name;.cfg">
<INLINE> <INLINE>
<![CDATA[ <![CDATA[
SERVICE="disable" SERVICE="disable"
DOCROOT="/mnt/cache/appdata/Aesir" DOCROOT="/mnt/cache/appdata/Aesir"
PORT="8088" PORT="8088"
RUNAS="nobody" RUNAS="root"
]]> ]]>
</INLINE> </INLINE>
</FILE> </FILE>
@ -50,15 +52,15 @@ RUNAS="nobody"
<!-- <!--
The 'plugin' package file. The 'plugin' package file.
--> -->
<FILE Name="&plgpath;/&plgname;.txz"> <FILE Name="&plgPATH;/&plgNAME;.txz">
<URL>&gitURL;/archive/&plgname;.txz</URL> <URL>&gitURL;/archive/&plgNAME;.txz</URL>
</FILE> </FILE>
<!-- <!--
The 'plugin' package MD5 hash. The 'plugin' package MD5 hash.
--> -->
<FILE Name="&plgpath;/&plgname;.md5"> <FILE Name="&plgPATH;/&plgNAME;.md5">
<URL>&gitURL;/archive/&plgname;.md5</URL> <URL>&gitURL;/archive/&plgNAME;.md5</URL>
</FILE> </FILE>
<!-- <!--
@ -74,23 +76,23 @@ if [[ ${version:0:3} == 6.0 ]]; then
fi fi
# Verify and install plugin package # Verify and install plugin package
sum1=$(/usr/bin/md5sum &plgpath;/&plgname;.txz) sum1=$(/usr/bin/md5sum &plgPATH;/&plgNAME;.txz)
sum2=$(/usr/bin/cat &plgpath;/&plgname;.md5) sum2=$(/usr/bin/cat &plgPATH;/&plgNAME;.md5)
if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then
echo "Wrong 'plugin' package md5 hash." echo "Wrong 'plugin' package md5 hash."
rm &plgpath;/&plgname;.txz rm &plgPATH;/&plgNAME;.txz
rm &plgpath;/&plgname;.md5 rm &plgPATH;/&plgNAME;.md5
exit 1 exit 1
else else
upgradepkg --install-new &plgpath;/&plgname;.txz upgradepkg --install-new &plgPATH;/&plgNAME;.txz
fi fi
# Update file permissions of plugin scripts # Update file permissions of plugin scripts
chmod +0755 &emhttp;/scripts/* chmod +0755 &emhttp;/scripts/*
# Cleaning old source files # Cleaning old source files
find &plgpath;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete find &plgPATH;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete
find &plgpath;/ -type f -iname "&name;*.md5" ! -iname "*&version;*" -delete find &plgPATH;/ -type f -iname "&name;*.md5" ! -iname "*&version;*" -delete
echo "" echo ""
echo "-----------------------------------------------------------" echo "-----------------------------------------------------------"
@ -109,11 +111,11 @@ The 'remove' script.
<FILE Run="/bin/bash" Method="remove"> <FILE Run="/bin/bash" Method="remove">
<INLINE> <INLINE>
/usr/local/emhttp/plugins/&name;/scripts/stop /usr/local/emhttp/plugins/&name;/scripts/stop
removepkg &plgpath;/*.txz removepkg &plgPATH;/*.txz
rm -rf &emhttp; rm -rf &emhttp;
rm -f &plgpath;/*.txz rm -f &plgPATH;/*.txz
rm -f &plgpath;/*.md5 rm -f &plgPATH;/*.md5
rm -f &gitTAR;
echo "" echo ""
echo "-----------------------------------------------------------" echo "-----------------------------------------------------------"
echo " &name; has been removed." echo " &name; has been removed."
@ -133,7 +135,7 @@ CFGFILE=/boot/config/plugins/aesir-plugin/aesir-plugin.cfg
[ ! `cat "$CFGFILE" | grep SERVICE` ] && echo "SERVICE=\"disable\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep SERVICE` ] && echo "SERVICE=\"disable\"" >> "$CFGFILE"
[ ! `cat "$CFGFILE" | grep DOCROOT` ] && echo "DOCROOT=\"/mnt/cache/appdata/Aesir\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep DOCROOT` ] && echo "DOCROOT=\"/mnt/cache/appdata/Aesir\"" >> "$CFGFILE"
[ ! `cat "$CFGFILE" | grep ^PORT` ] && echo "PORT=\"8088\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep ^PORT` ] && echo "PORT=\"8088\"" >> "$CFGFILE"
[ ! `cat "$CFGFILE" | grep RUNAS` ] && echo "RUNAS=\"nobody\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep RUNAS` ] && echo "RUNAS=\"root\"" >> "$CFGFILE"
rm /tmp/aesir-plugin-chkconf rm /tmp/aesir-plugin-chkconf
]]> ]]>
</INLINE> </INLINE>