Files
tv/runembysim.sh

73 lines
1.7 KiB
Bash

#!/bin/bash
prog="$0"
while [ -h "${prog}" ]; do
newProg=`/bin/ls -ld "${prog}"`
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
if expr "x${newProg}" : 'x/' >/dev/null; then
prog="${newProg}"
else
progdir=`dirname "${prog}"`
prog="${progdir}/${newProg}"
fi
done
progdir=`dirname "${prog}"`
cd "${progdir}"
progdir=$(pwd)
mkdir -p emby.tmp emby.cache >/dev/null 2>&1
chmod 777 emby.tmp emby.cache
docker stop embysim
docker rm embysim
num=$(mount |grep "/external"|wc -l)
if [ $num -lt 1 ]; then
mount -o bind,shared emby.external external
echo "mount emby.external to external to mark shared"
fi
if [ ! -e alistservers.txt ]; then
cp alistservers.template.txt alistservers.txt
fi
interface=$(ip route show | grep default | awk '{print $5}')
export SELFIP=$(ip addr show $interface | grep -w inet | awk '{print $2}' | cut -d/ -f1|head -1)
echo "DETECT SELF IP:${SELFIP}, if this is not correct, change SELFIP to your real ip"
num=$(mount |grep "/rclone.media"|wc -l)
if [ $num -gt 0 ]; then
echo "WARN: rclone.media already mounted, the webdav content may be outdate"
else
./rclonemount.sh
fi
num=$(mount |grep "/rclone.media"|wc -l)
if [ $num -lt 1 ]; then
echo "ERROR: rclone not running, exit"
exit
fi
# --gpus all \
# -e HTTP_PROXY=http://192.168.101.1:8118 \
# -e HTTPS_PROXY=http://192.168.101.1:8118 \
# --net=host \
docker run -d \
--sysctl net.ipv6.conf.all.disable_ipv6=1 \
--name embysim \
-v $progdir/emby.config:/config \
-v $progdir/external:/external:rshared \
-v $progdir/emby.tmp:/tmp \
-v $progdir/emby.cache:/cache \
--device /dev/dri:/dev/dri \
-p 8096:8096 \
-p 8920:8920 \
--env UID=1000 \
--env GID=100 \
--env GIDLIST=100 \
--env SELFIP=${SELFIP} \
--restart on-failure \
pandagroove/embysim:1.0.0