2025-07-02 10:40:08 +08:00
|
|
|
#!/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)
|
|
|
|
|
|
|
|
if [ "$SELFIP" == "" ]; then
|
|
|
|
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"
|
|
|
|
fi
|
|
|
|
|
|
|
|
unset LD_PRELOAD
|
|
|
|
machine=$(uname -m)
|
|
|
|
if [[ "$machine" == *"arm"* || "$machine" == *"aarch"* ]]; then
|
|
|
|
arch="arm64"
|
|
|
|
else
|
|
|
|
arch="amd64"
|
|
|
|
fi
|
|
|
|
echo "arch:$arch"
|
|
|
|
chmod 755 webdav_simulator.$arch
|
|
|
|
WEBDAV_PORT=5678
|
2025-07-07 09:47:34 +08:00
|
|
|
rm -rf tmp.${WEBDAV_PORT}
|
|
|
|
mkdir tmp.${WEBDAV_PORT}
|
|
|
|
chmod 777 tmp.${WEBDAV_PORT}
|
|
|
|
export TMPDIR=tmp.${WEBDAV_PORT}
|
2025-07-02 10:40:08 +08:00
|
|
|
while true
|
|
|
|
do
|
|
|
|
curl -v -L "http://127.0.0.1:${WEBDAV_PORT}/dav"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
./webdav_simulator.$arch --selfip $SELFIP --port ${WEBDAV_PORT} --noindex --alist_config alistservers.txt --username guest --password guest_Api789 --proxymode 1 --blackwords '抖音,短剧,音乐22,mp3,wav' --fake_media_file fake.mkv --strmmode 'xy115-all.txt.xz#xy-dy.txt.xz#xy-dsj.txt.xz#xy115-music.txt.xz'
|
|
|
|
echo "webdavsim exit, sleep 5s and restart"
|
|
|
|
else
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
sleep 5
|
|
|
|
done
|