更新文件: tmuxrunwebdavsim.sh, rclonemount.sh, attach.sh, install.sh, runembysim.sh 等6个文件

This commit is contained in:
ZJP Monitor
2025-07-02 19:48:26 +08:00
parent a45a368413
commit 186dee884e
6 changed files with 49 additions and 11 deletions

3
attach.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
tmux attach -t webdavsim

View File

@ -18,13 +18,20 @@ 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 "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"
echo "extract embysim data and prog..."
tar xf ../embysim.tar.xz
@ -34,7 +41,7 @@ if [ ! -e alistservers.txt ]; then
fi
echo "copy scripts..."
mv ../webdav_simulator.amd64 ../htdocs ../runwebdavsim.sh ../rclonemount.sh ../runembysim.sh ../rclone.conf ../xy*.txt.xz .
mv ../webdav_simulator.amd64 ../htdocs ../runwebdavsim.sh ../killwebdavsim.sh ../tmuxrunwebdavsim.sh ../attach.sh ../rclonemount.sh ../runembysim.sh ../rclone.conf ../xy*.txt.xz .
echo "copy scripts finish"
echo "all assets installed"

10
killwebdavsim.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
killall -9 runwebdavsim.sh
pidlist=$(ps -ef|grep "/webdav_simulator"|grep -- "--port 5678"|grep -v grep|awk '{print $2}')
for pid in $pidlist
do
echo $pid
kill -9 $pid
done

View File

@ -18,7 +18,7 @@ progdir=$(pwd)
num=$(mount |grep "/external"|wc -l)
if [ $num -lt 1 ]; then
mkdir -p external
mkdir -p external >/dev/null 2>&1
mount -o bind,shared emby.external external
echo "mount emby.external to external to mark shared"
fi
@ -44,7 +44,14 @@ if [ $? -eq 0 ]; then
echo "WARN:webdavsim is running, data may be outdate."
else
echo "run webdavsim..."
nohup ./runwebdavsim.sh >/dev/null 2>&1 &
tmux -V
if [ $? -eq 0 ]; then
chmod u+x tmuxrunwebdavsim.sh
./tmuxrunwebdavsim.sh
else
chmod u+x tmuxrunwebdavsim.sh
nohup ./runwebdavsim.sh >/dev/null 2>&1 &
fi
fi
echo "TRY CONNECT webdavsim, please wait... abount(30s)"

View File

@ -24,6 +24,7 @@ docker rm embysim
num=$(mount |grep "/external"|wc -l)
if [ $num -lt 1 ]; then
mkdir external >/dev/null 2>&1
mount -o bind,shared emby.external external
echo "mount emby.external to external to mark shared"
fi
@ -40,6 +41,7 @@ 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
chmod u+x rclonemount.sh
./rclonemount.sh
fi
@ -69,4 +71,6 @@ docker run -d \
--env GIDLIST=100 \
--env SELFIP=${SELFIP} \
--restart on-failure \
pandagroove/embysim:1.0.0
emby/embyserver:latest
#pandagroove/embysim:1.0.0

7
tmuxrunwebdavsim.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
export LANG="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"
chmod u+x runwebdavsim.sh
tmux new-session -d -s webdavsim "./runwebdavsim.sh"
#./attach.sh