Centos安装一键式UnblockNeteaseMusic

董法
2023-12-01

仓库传送:UnblockNeteaseMusic

  • 安装nodejs
curl -sL http://rpm.nodesource.com/setup_18.x | bash-
yum install -y nodej
  • 安装git环境
yum install git -y
  • 克隆项目
git clone http://https://github.com/nondanee/UnblockNeteaseMusic.git
git clone https://gitee.com/leopku/UnblockNeteaseMusic.git
  • 打开项目
cd UnblockNeteaseMusic
  • 运行项目
npx @nondanee/unblockneteasemusic
node app.js -p 8000:8002 -e http://music.163.com -s
  • 开机自启动服务
vim /etc/systemd/system/UnblockNeteaseMusic.service
[Unit]
Description=UnblockNeteaseMusic
After=network.target
Wants=network.target

[Service]
Type=simple
PIDFile=/var/run/UnblockNeteaseMusic.pid
WorkingDirectory=/root/UnblockNeteaseMusic
ExecStart=/usr/bin/node app.js -p 4000:4002 -e https://music.163.com -s
Restart=always
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target
  • 服务自启动
sudo systemctl start UnblockNeteaseMusic
sudo systemctl enable UnblockNeteaseMusic.service
 类似资料: