initial commit

This commit is contained in:
ksurl
2020-11-26 17:32:01 -08:00
parent d1dc6e5858
commit 1a317175ab
7 changed files with 50 additions and 71 deletions
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/with-contenv bash
# install git if needed
if [ -z `command -v git` ]; then
echo "**** installing git ****"
apt-get update && 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
else
echo "**** updating scanner repo ****"
git -C /config/absolute pull
fi
scannerdir="/config/Library/Application Support/Plex Media Server/Scanners/Series"
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 ****"
cp -f "/config/absolute/Scanners/Series/Absolute Series Scanner.py" "$scannerdir/Absolute Series Scanner.py"
fi
fi
chown -R abc:abc "$scannerdir"
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"
else
echo "**** pulling latest update ****"
git -C "$plugindir/Hama.bundle" pull
fi
chown -R abc:abc "$plugindir/Hama.bundle"
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/with-contenv bash
# Determine if setup is needed
if [ ! -f /usr/local/lib/python***/dist-packages/sshuttle ] && \
[ -f /usr/bin/apt ]; then
## Ubuntu
apt-get update
apt-get install --no-install-recommends -y \
iptables \
openssh-client \
python3 \
python3-pip
pip3 install sshuttle
fi
if [ ! -f /usr/lib/python***/site-packages/sshuttle ] && \
[ -f /sbin/apk ]; then
# Alpine
apk add --no-cache \
iptables \
openssh \
py3-pip \
python3
pip3 install sshuttle
fi
chown -R root:root /root
chmod -R 600 /root/.ssh
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/with-contenv bash
sshuttle --dns --remote root@${HOST}:${PORT} 0/0 -x 172.17.0.0/16