Merge pull request #249 from linuxserver/plex-absolute-hama-apt

This commit is contained in:
Roxedus 2021-09-26 22:18:47 +02:00 committed by GitHub
commit af2dafc78b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View File

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
apt-get update

View File

@ -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"