#!/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 embysim cd embysim #echo "extract embysim docker image..." #xz -dc -v ../embysim.docker.tar.xz > embysim.docker.tar #echo "extract embysim docker image finish" #echo "load embysim docker to system..." #docker load -i embysim.docker.tar #rm -f embysim.docker.tar #echo "load embysim docker to system finish" echo "ready to docker pull emby/embyserver:latest..." docker pull emby/embyserver:latest if [ $? -ne 0 ]; then echo "docker pull fail, exit" exit fi echo "docker pull finish" if [ -e ../embysim.tar.xz ]; then echo "extract embysim data and prog..." tar xf ../embysim.tar.xz echo "extract embysim data and prog finish" fi if [ ! -e alistservers.txt ]; then cp ../alistservers.template.txt alistservers.txt fi if [ ! -e emby.config/config/system.xml ]; then mv ../system.xml emby.config/config/system.xml chmod 777 emby.config/config/system.xml fi echo "copy scripts..." cp -a ../webdav_simulator.amd64 ../htdocs ../runwebdavsim.sh ../killwebdavsim.sh ../tmuxrunwebdavsim.sh ../attach.sh ../rclonemount.sh ../runembysim.sh ../rclone.conf ../xy*.txt.xz ../externalPlayer.js . rm -f ../webdav_simulator.amd64 ../htdocs ../runwebdavsim.sh ../killwebdavsim.sh ../tmuxrunwebdavsim.sh ../attach.sh ../rclonemount.sh ../runembysim.sh ../rclone.conf ../xy*.txt.xz ../externalPlayer.js chmod u+x *.sh echo "copy scripts finish" echo "all assets installed" cd .. echo "You can run embysim/runembysim.sh to start"