#!/bin/bash
echo "2s后开始安装";
sleep 2s

sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc
sudo chmod a+r /etc/apt/keyrings/sagernet.asc
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null
sudo apt-get update
sudo apt-get install sing-box
systemctl restart sing-box

sleep 2s

rm -rf /etc/sing-box/config.json
wget --no-check-certificate https://file.hassy.co/sing-box/config.json
mv config.json /etc/sing-box/config.json

systemctl restart sing-box