diff --git a/root/etc/cont-init.d/95-apt-get b/root/etc/cont-init.d/95-apt-get new file mode 100644 index 0000000..5b1a21c --- /dev/null +++ b/root/etc/cont-init.d/95-apt-get @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +apt-get update diff --git a/root/etc/cont-init.d/98-absolute-hama b/root/etc/cont-init.d/98-absolute-hama index 606c208..e23f1b4 100644 --- a/root/etc/cont-init.d/98-absolute-hama +++ b/root/etc/cont-init.d/98-absolute-hama @@ -2,17 +2,17 @@ # install git if needed if [ -z `command -v git` ]; then - echo "**** installing git ****" - apt-get update && apt-get install --no-install-recommends -y git + echo "**** installing git ****" + apt-get install --no-install-recommends -y git fi # clone or update Absolute Series Scanner repo if [ ! -d /config/absolute ]; then - echo "**** no scanner repo found, cloning. ****" - git clone --depth 1 https://github.com/ZeroQI/Absolute-Series-Scanner /config/absolute + echo "**** no scanner repo found, cloning. ****" + git clone --depth 1 https://github.com/ZeroQI/Absolute-Series-Scanner /config/absolute else - echo "**** updating scanner repo ****" - git -C /config/absolute pull + echo "**** updating scanner repo ****" + git -C /config/absolute pull fi scannerdir="/config/Library/Application Support/Plex Media Server/Scanners/Series" @@ -20,13 +20,13 @@ mkdir -p "$scannerdir" # copy the scanner if missing or out of date if [ ! -f "$scannerdir/Absolute Series Scanner.py" ]; then - echo "**** no scanner found. copying from repo ****" - cp -f "/config/absolute/Scanners/Series/Absolute Series Scanner.py" "$scannerdir/Absolute Series Scanner.py" -else - if [ $(date -r "$scannerdir/Absolute Series Scanner.py" +%s) -lt $(date -r "/config/absolute/Scanners/Series/Absolute Series Scanner.py" +%s) ]; then - echo "**** scanner out of date, copying latest version ****" + echo "**** no scanner found. copying from repo ****" cp -f "/config/absolute/Scanners/Series/Absolute Series Scanner.py" "$scannerdir/Absolute Series Scanner.py" - fi +else + if [ $(date -r "$scannerdir/Absolute Series Scanner.py" +%s) -lt $(date -r "/config/absolute/Scanners/Series/Absolute Series Scanner.py" +%s) ]; then + echo "**** scanner out of date, copying latest version ****" + cp -f "/config/absolute/Scanners/Series/Absolute Series Scanner.py" "$scannerdir/Absolute Series Scanner.py" + fi fi chown -R abc:abc "$scannerdir" @@ -34,10 +34,10 @@ plugindir="/config/Library/Application Support/Plex Media Server/Plug-ins" # clone or update Hama.bundle repo if [ ! -d "$plugindir/Hama.bundle" ]; then - echo "**** no agent found, cloning ****" - git clone --depth 1 https://github.com/ZeroQI/Hama.bundle "$plugindir/Hama.bundle" + echo "**** no agent found, cloning ****" + git clone --depth 1 https://github.com/ZeroQI/Hama.bundle "$plugindir/Hama.bundle" else - echo "**** pulling latest update ****" - git -C "$plugindir/Hama.bundle" pull + echo "**** pulling latest update ****" + git -C "$plugindir/Hama.bundle" pull fi chown -R abc:abc "$plugindir/Hama.bundle"