From 9e63066eea9b16a67b93c11b4041defef87a40b1 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Sun, 11 Jun 2017 00:48:27 +0100 Subject: [PATCH] change paths, tidy up, remove grab on start --- Dockerfile | 29 ++++++++++++++++++----------- root/defaults/abc | 1 - root/{wg++ => defaults}/update.sh | 5 +++-- root/defaults/wg-cron | 1 + root/etc/cont-init.d/30-config | 21 ++++++++------------- root/etc/cont-init.d/40-grab | 9 --------- 6 files changed, 30 insertions(+), 36 deletions(-) delete mode 100644 root/defaults/abc rename root/{wg++ => defaults}/update.sh (65%) create mode 100644 root/defaults/wg-cron delete mode 100644 root/etc/cont-init.d/40-grab diff --git a/Dockerfile b/Dockerfile index e931871..ffe9021 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,8 @@ ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" # Set correct environment variables. -ENV HOME /config ARG DEBIAN_FRONTEND="noninteractive" +ENV HOME /config # install runtime dependencies RUN \ @@ -16,19 +16,26 @@ RUN \ apt-get install -y \ cron && \ -# download and extract WG++ to correct paths - mkdir wg++ && \ +# install webgrab + mkdir -p \ + /app/wg++ && \ curl -o /tmp/wg++.tar.gz -L \ http://webgrabplus.com/sites/default/files/download/SW/V2.0.0/WebGrabPlus_V2.0_install.tar.gz && \ - tar xzf /tmp/wg++.tar.gz --strip-components=1 -C /wg++/ && \ + tar xzf \ + /tmp/wg++.tar.gz -C \ + /app/wg++ --strip-components=1 && \ -# download update - curl -o /tmp/update.tar.gz -L \ +# install wg-update + curl -o \ + /tmp/update.tar.gz -L \ http://webgrabplus.com/sites/default/files/download/SW/V2.0.7/WebGrabPlus_V2.0.7_beta_install.tar.gz && \ - tar xf /tmp/update.tar.gz --strip-components=2 -C /wg++/bin/ && \ + tar xf \ + /tmp/update.tar.gz -C \ + /app/wg++/bin/ --strip-components=2 && \ -# download Siteini.pack - curl -o /tmp/ini.zip -L \ +# download siteini.pack + curl -o \ + /tmp/ini.zip -L \ http://webgrabplus.com/sites/default/files/download/ini/SiteIniPack_current.zip && \ unzip /tmp/ini.zip -d /defaults/ini/ && \ @@ -41,5 +48,5 @@ RUN \ # copy files COPY root/ / -VOLUME /config \ - /data +# ports and volumes +VOLUME /config /data diff --git a/root/defaults/abc b/root/defaults/abc deleted file mode 100644 index d1c4321..0000000 --- a/root/defaults/abc +++ /dev/null @@ -1 +0,0 @@ -2 3 * * * /wg++/update.sh diff --git a/root/wg++/update.sh b/root/defaults/update.sh similarity index 65% rename from root/wg++/update.sh rename to root/defaults/update.sh index 71ce14a..b4daaff 100644 --- a/root/wg++/update.sh +++ b/root/defaults/update.sh @@ -1,5 +1,6 @@ #!/usr/bin/with-contenv bash -cd /wg++/bin +cd /app/wg++/bin || exit + mono WebGrab+Plus.exe "/config" -exit 0 \ No newline at end of file +exit 0 diff --git a/root/defaults/wg-cron b/root/defaults/wg-cron new file mode 100644 index 0000000..36d2daa --- /dev/null +++ b/root/defaults/wg-cron @@ -0,0 +1 @@ +2 3 * * * /defaults/update.sh diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 9924399..b3ac100 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -1,23 +1,18 @@ #!/usr/bin/with-contenv bash -# Check if Webgrab++ config file exists in config folder. +# copy config [[ ! -e /config/WebGrab++.config.xml ]] && \ cp /defaults/WebGrab++.config.xml /config/ - -# Check if Ini folder exists in config folder. [[ ! -e /config/ini/siteini.pack ]] && \ cp -R /defaults/ini/siteini.pack /config/ -# Copy default cron file if not in config -[[ ! -e /config/abc ]] && \ - cp /defaults/abc /config/abc - # add cron file for running webgrab+plus -[[ -e /config/abc ]] && \ - crontab -u abc /config/abc +[[ ! -e /config/wg-cron ]] && \ + cp /defaults/wg-cron /config/wg-cron +crontab -u abc /config/wg-cron -# Change owner for config files and guide.xml -chown -R abc:abc /config \ - /data -chmod 766 /config \ +# permissions +chown -R abc:abc \ + /config \ /data + diff --git a/root/etc/cont-init.d/40-grab b/root/etc/cont-init.d/40-grab deleted file mode 100644 index b0f10f3..0000000 --- a/root/etc/cont-init.d/40-grab +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/with-contenv bash - -[[ -e /config/WebGrab++.config.xml ]] && \ - cd /wg++/bin || exit - exec \ - s6-setuidgid abc \ - mono WebGrab+Plus.exe "/config" - -exit 0 \ No newline at end of file