From f2e338529a3e6fbe56da7a9995120b75809b04a8 Mon Sep 17 00:00:00 2001 From: dmacias72 Date: Fri, 16 Sep 2016 15:35:01 -0600 Subject: [PATCH] update --- plugins/apache.plg | 114 +++++++++++++++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 35 deletions(-) diff --git a/plugins/apache.plg b/plugins/apache.plg index 0c4ceb71..723d9e03 100755 --- a/plugins/apache.plg +++ b/plugins/apache.plg @@ -130,11 +130,38 @@ This Plugin installs and controls The Apache HTTP Server ("httpd") for unRaid 6. 6942fb6f9f78b8e3cc4a1c77469a2512 + + + + + + + + + + + + - -"https://github.com/&author;/&name;/archive/&version;.tar.gz" + +&gitURL;/archive/&plgname;.txz + + + + +&gitURL;/archive/&plgname;.md5 -if [ ! -d &emhttp; ]; then - mkdir -p &emhttp; -fi -tar -zxf &plugin;/&name;-&version;.tar.gz --strip=1 -C &emhttp;/ -find &plugin; -type f -iname "*.tar.gz" ! -iname "&name;-&version;.tar.gz" -delete -chmod +0770 /usr/local/emhttp/plugins/&name;/scripts/* -cp -nr /usr/local/emhttp/plugins/&name;/&name; /boot/config/plugins +#Verify unRAID Version +source /etc/unraid-version +VER=${version:0:3} + +if [[ $VER == 6.1 ]]; then + echo "unRAID version 6.2 or higher is required" + exit 1 +fi + +# Verify and install plugin package +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." + rm &plgpath;/&plgname;.txz + rm &plgpath;/&plgname;.md5 + exit 1 +else + upgradepkg --install-new &plgpath;/&plgname;.txz + + # Cleaning old source files + find &plgpath;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete + find &plgpath;/ -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 2016, &author;" +echo " Version: &version;" +echo "-----------------------------------------------------------" +echo "" -if [ ! -L /var/www/htdocs ]; then - mv -T /var/www/htdocs /var/www/html fi -ln -sfT /var/www/html /srv/httpd/htdocs -rm -rf /etc/httpd -ln -sfT &plugin;/httpd /etc/httpd @@ -164,25 +211,22 @@ The 'remove' script. --> -/usr/local/emhttp/plugins/&name;/scripts/stop -rm -rf /usr/local/emhttp/plugins/&name; -rm -f &plugin;/&name;-&version;.tar.gz +&emhttp;/scripts/stop +removepkg &plgpath;/&plgname;.txz +rm -rf &emhttp; +rm -f &plgpath;/&plgname;.txz +rm -f &plgpath;/&plgname;.md5 + +#remove installed packages +removepkg &plgpath;/*.txz +rm -f &plgpath;/*.txz + +echo "" +echo "-----------------------------------------------------------" +echo " &name; has been removed." +echo " Copyright 2016, &author;" +echo " Version: &version;" +echo "-----------------------------------------------------------" +echo "" - - - -> "$CFGFILE" -[ ! `cat "$CFGFILE" | grep DOCROOT` ] && echo "DOCROOT=\"/var/www/html\"" >> "$CFGFILE" -[ ! `cat "$CFGFILE" | grep ^PORT` ] && echo "PORT=\"8088\"" >> "$CFGFILE" -[ ! `cat "$CFGFILE" | grep RUNAS` ] && echo "RUNAS=\"nobody\"" >> "$CFGFILE" -rm /tmp/apache-chkconf -]]> - - - -