2025-03-15 11:28:12 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# start unblock service in the background
|
2025-10-18 19:56:20 +08:00
|
|
|
npx unblockneteasemusic -p 80:443 -s -f ${NETEASE_SERVER_IP:-220.197.30.65} -o ${UNBLOCK_SOURCES:-kugou bodian pyncmd} 2>&1 &
|
2025-03-15 11:28:12 +08:00
|
|
|
|
|
|
|
|
# point the neteasemusic address to the unblock service
|
|
|
|
|
if ! grep -q "music.163.com" /etc/hosts; then
|
|
|
|
|
echo "127.0.0.1 music.163.com" >> /etc/hosts
|
|
|
|
|
fi
|
|
|
|
|
if ! grep -q "interface.music.163.com" /etc/hosts; then
|
|
|
|
|
echo "127.0.0.1 interface.music.163.com" >> /etc/hosts
|
|
|
|
|
fi
|
|
|
|
|
if ! grep -q "interface3.music.163.com" /etc/hosts; then
|
|
|
|
|
echo "127.0.0.1 interface3.music.163.com" >> /etc/hosts
|
|
|
|
|
fi
|
|
|
|
|
if ! grep -q "interface.music.163.com.163jiasu.com" /etc/hosts; then
|
|
|
|
|
echo "127.0.0.1 interface.music.163.com.163jiasu.com" >> /etc/hosts
|
|
|
|
|
fi
|
|
|
|
|
if ! grep -q "interface3.music.163.com.163jiasu.com" /etc/hosts; then
|
|
|
|
|
echo "127.0.0.1 interface3.music.163.com.163jiasu.com" >> /etc/hosts
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# start the nginx daemon
|
|
|
|
|
nginx
|
|
|
|
|
|
|
|
|
|
# start the main process
|
|
|
|
|
exec "$@"
|