Update sb.sh
This commit is contained in:
@@ -3084,7 +3084,7 @@ subtoken="$(sed 's://.*::g' /etc/s-box/sb.json | jq -r '.inbounds[0].users[0].uu
|
||||
else
|
||||
subtoken="$menu"
|
||||
fi
|
||||
rm -rf /root/web/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"
|
||||
rm -rf /root/websbox/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"
|
||||
echo $subtoken > /etc/s-box/subtoken.log
|
||||
green "订阅链接路径密码:$(cat /etc/s-box/subtoken.log 2>/dev/null)"
|
||||
}
|
||||
@@ -3118,7 +3118,7 @@ crontab -l 2>/dev/null > /tmp/crontab.tmp
|
||||
sed -i '/httpd -f -p/d' /tmp/crontab.tmp
|
||||
crontab /tmp/crontab.tmp >/dev/null 2>&1
|
||||
rm /tmp/crontab.tmp
|
||||
rm -rf /root/web
|
||||
rm -rf /root/websbox
|
||||
rm -rf /etc/local.d/alpinesub.start
|
||||
green "本地IP订阅链接已卸载完成" && sleep 3 && exit
|
||||
else
|
||||
@@ -3127,28 +3127,28 @@ fi
|
||||
echo
|
||||
green "请稍后…………"
|
||||
ps -ef | grep "$(cat /etc/s-box/subport.log 2>/dev/null)" | grep -v grep | awk 'NR==1 {print $2}' | xargs kill 2>/dev/null
|
||||
mkdir -p /root/web/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"
|
||||
ln -sf /etc/s-box/clmi.yaml /root/web/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"/clmi.yaml
|
||||
ln -sf /etc/s-box/sbox.json /root/web/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"/sbox.json
|
||||
ln -sf /etc/s-box/jhsub.txt /root/web/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"/jhsub.txt
|
||||
mkdir -p /root/websbox/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"
|
||||
ln -sf /etc/s-box/clmi.yaml /root/websbox/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"/clmi.yaml
|
||||
ln -sf /etc/s-box/sbox.json /root/websbox/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"/sbox.json
|
||||
ln -sf /etc/s-box/jhsub.txt /root/websbox/"$(cat /etc/s-box/subtoken.log 2>/dev/null)"/jhsub.txt
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
busybox-extras httpd -f -p "$(cat /etc/s-box/subport.log 2>/dev/null)" -h /root/web > /dev/null 2>&1 &
|
||||
busybox-extras httpd -f -p "$(cat /etc/s-box/subport.log 2>/dev/null)" -h /root/websbox > /dev/null 2>&1 &
|
||||
else
|
||||
busybox httpd -f -p "$(cat /etc/s-box/subport.log 2>/dev/null)" -h /root/web > /dev/null 2>&1 &
|
||||
busybox httpd -f -p "$(cat /etc/s-box/subport.log 2>/dev/null)" -h /root/websbox > /dev/null 2>&1 &
|
||||
fi
|
||||
sleep 5
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
cat > /etc/local.d/alpinesub.start <<'EOF'
|
||||
#!/bin/bash
|
||||
sleep 10
|
||||
busybox-extras httpd -f -p $(cat /etc/s-box/subport.log 2>/dev/null) -h /root/web > /dev/null 2>&1 &
|
||||
busybox-extras httpd -f -p $(cat /etc/s-box/subport.log 2>/dev/null) -h /root/websbox > /dev/null 2>&1 &
|
||||
EOF
|
||||
chmod +x /etc/local.d/alpinesub.start
|
||||
rc-update add local default >/dev/null 2>&1
|
||||
else
|
||||
crontab -l 2>/dev/null > /tmp/crontab.tmp
|
||||
sed -i '/httpd -f -p/d' /tmp/crontab.tmp
|
||||
echo '@reboot sleep 10 && /bin/bash -c "busybox httpd -f -p $(cat /etc/s-box/subport.log 2>/dev/null) -h /root/web > /dev/null 2>&1 &"' >> /tmp/crontab.tmp
|
||||
echo '@reboot sleep 10 && /bin/bash -c "busybox httpd -f -p $(cat /etc/s-box/subport.log 2>/dev/null) -h /root/websbox > /dev/null 2>&1 &"' >> /tmp/crontab.tmp
|
||||
crontab /tmp/crontab.tmp >/dev/null 2>&1
|
||||
rm /tmp/crontab.tmp
|
||||
fi
|
||||
@@ -3889,7 +3889,7 @@ fi
|
||||
ps -ef | grep '[c]loudflared.*url' | awk '{print $2}' | xargs kill 2>/dev/null
|
||||
ps -ef | grep '[s]bwpph' | awk '{print $2}' | xargs kill 2>/dev/null
|
||||
ps -ef | grep "$(cat /etc/s-box/subport.log 2>/dev/null)" | grep -v grep | awk 'NR==1 {print $2}' | xargs kill 2>/dev/null
|
||||
rm -rf /etc/s-box sbyg_update /usr/bin/sb /root/geoip.db /root/geosite.db /root/warpapi /root/warpip /root/web
|
||||
rm -rf /etc/s-box sbyg_update /usr/bin/sb /root/geoip.db /root/geosite.db /root/warpapi /root/warpip /root/websbox
|
||||
rm -f /etc/local.d/alpineargo.start /etc/local.d/alpinesub.start /etc/local.d/alpinews5.start
|
||||
uncronsb
|
||||
iptables -t nat -F PREROUTING >/dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user