mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
standardize apt-get
This commit is contained in:
parent
6f96b8962b
commit
7c008d466f
3
root/etc/cont-init.d/95-apt-get
Normal file
3
root/etc/cont-init.d/95-apt-get
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
apt-get update
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user