mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 07:51:45 +00:00
Compare commits
9 Commits
1.9.5alpha
...
1.9.5alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38d081f40a | ||
|
|
6e41971725 | ||
|
|
bbe711b1ce | ||
|
|
bae05042db | ||
|
|
ee523035a6 | ||
|
|
aae0bd1880 | ||
|
|
95909e84c2 | ||
|
|
847010399d | ||
|
|
517675ff53 |
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
meta_v=v1.19.17
|
||||
singboxr_v=1.13.0-alpha.27
|
||||
versionsh=1.9.5alpha6.1
|
||||
versionsh=1.9.5alpha6.3
|
||||
GeoIP_v=20251205
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# ===== 启动完成 =====
|
||||
START_SERVICE_OK="服务已启动!"
|
||||
START_WEB_HINT="请前往"
|
||||
START_WEB_HINT2="管理内置规则"
|
||||
START_WEB_HINT="管理面板:"
|
||||
START_PAC_HINT="其他设备可使用 PAC 配置:"
|
||||
START_PROXY_HINT="或使用 HTTP / SOCKS5 方式连接:"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# ===== Startup =====
|
||||
START_SERVICE_OK="Service started successfully!"
|
||||
START_WEB_HINT="Please use"
|
||||
START_WEB_HINT2="manage built-in rules"
|
||||
START_WEB_HINT="Dashboard:"
|
||||
START_PAC_HINT="Other devices can connect using PAC configuration:"
|
||||
START_PROXY_HINT="Or connect using HTTP / SOCKS5:"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ startover() {
|
||||
line_break
|
||||
separator_line "="
|
||||
content_line "\033[32m$START_SERVICE_OK\033[0m"
|
||||
content_line "$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m $START_WEB_HINT2"
|
||||
content_line "$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m"
|
||||
|
||||
if [ "$firewall_area" = 4 ]; then
|
||||
content_line ""
|
||||
|
||||
@@ -17,14 +17,15 @@ URI_EXP='ss|vmess|vless|trojan|tuic|anytls|shadowtls|hysteria(2)?'
|
||||
set_core_config() {
|
||||
while true; do
|
||||
list=$(cat "$CRASHDIR"/configs/providers.cfg "$CRASHDIR"/configs/providers_uri.cfg 2>/dev/null |
|
||||
awk '{
|
||||
LC_ALL=C awk '{
|
||||
f1 = $1
|
||||
f2 = $2
|
||||
gsub(/\360[\200-\277][\200-\277][\200-\277]/,"",f1)
|
||||
if (length(f1) > 12)
|
||||
f1 = substr(f1, 1, 9) ".."
|
||||
if (length(f2) > 39)
|
||||
f2 = substr(f2, 1, 36) "..."
|
||||
printf "%-10s\t%-30s\n", f1, f2
|
||||
f1 = substr(f1, 1, 8) ".."
|
||||
if (length(f2) > 30)
|
||||
f2 = substr(f2, 1, 30) "..."
|
||||
printf "%-7s \t%-28s\n", f1, f2
|
||||
}')
|
||||
comp_box "\033[30;47m配置文件管理\033[0m"
|
||||
[ -n "$list" ] && {
|
||||
@@ -150,11 +151,11 @@ setproviders() {
|
||||
;;
|
||||
1)
|
||||
separator_line "="
|
||||
content_line "注意:名称或代号不可重复,且不支持纯数字!"
|
||||
content_line "注意:不可重复,不支持纯数字,且不要超过4个汉字!"
|
||||
separator_line "-"
|
||||
read -p "请输入具体名称或代号 > " text
|
||||
text=$(echo $text | sed 's/ //g') #去空格
|
||||
if [ -n "$text" ] && [ -z "$(echo "$text" | grep -E '^[0-9]+$')" ] && ! grep -q "$text" "$CRASHDIR"/configs/providers.cfg; then
|
||||
read -r -p "请输入具体名称或代号 > " text
|
||||
text=$(printf "%.12s" "$text" | sed 's/ //g') #截断12字符+去空格
|
||||
if [ -n "$text" ] && [ -z "$(echo "$text" | grep -E '^[0-9]+$')" ] && ! grep -q "^$text " "$CRASHDIR"/configs/providers.cfg; then
|
||||
name="$text"
|
||||
else
|
||||
error_input
|
||||
@@ -194,7 +195,8 @@ setproviders() {
|
||||
#处理本地文件
|
||||
file=$(printf '%s\n' "$list" | sed -n "${text}p")
|
||||
if [ -s "$CRASHDIR/providers/$file" ]; then
|
||||
link="$file"
|
||||
link="./providers/$file"
|
||||
[ -z "$name" ] && name="_$(printf "%.12s" "$file" | sed 's/ //g')"
|
||||
link_uri=''
|
||||
common_success
|
||||
else
|
||||
@@ -206,7 +208,7 @@ setproviders() {
|
||||
if [ -n "$(echo $text | grep -E "^$URI_EXP")" ]; then
|
||||
link_uri=$(echo "$text" | sed 's/#.*//g') # 删除注释
|
||||
link=''
|
||||
[ -z "$name" ] && name=$(printf '%b\n' "$(printf '%s' "$text" | sed 's/+/ /g; s/%/\\x/g')" | sed 's/.*#//')
|
||||
[ -z "$name" ] && name=$(printf '%b' "$(printf '%s' "$text" | sed 's/+/ /g; s/%/\\x/g')" | sed 's/.*#//')
|
||||
common_success
|
||||
else
|
||||
error_input
|
||||
|
||||
@@ -9,7 +9,7 @@ bot_tg_start(){
|
||||
}
|
||||
bot_tg_stop(){
|
||||
cronset 'TG_BOT守护进程'
|
||||
[ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")"
|
||||
[ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")" 2>/dev/null
|
||||
killall bot_tg.sh 2>/dev/null
|
||||
rm -f "$TMPDIR/bot_tg.pid"
|
||||
}
|
||||
|
||||
@@ -89,6 +89,8 @@ gen_providers_txt(){
|
||||
ua=${5:-clash.meta}
|
||||
exclude=${6#\#}
|
||||
include=${7#\#}
|
||||
[ -n "$exclude" ] && exclude_ele="\"exclude\": \"$exclude\","
|
||||
[ -n "$include" ] && include_ele="\"include\": \"$include\","
|
||||
if [ -n "$(echo $2|grep -E '^./')" ];then
|
||||
cat >> "$TMPDIR"/providers/providers.json <<EOF
|
||||
{
|
||||
@@ -105,8 +107,8 @@ EOF
|
||||
"path": "./providers/$tag.yaml",
|
||||
"user_agent": "$ua",
|
||||
"update_interval": "${interval2}h",
|
||||
"exclude": "$exclude",
|
||||
"include": "$include",
|
||||
$exclude_ele
|
||||
$include_ele
|
||||
EOF
|
||||
fi
|
||||
#通用部分生成
|
||||
|
||||
@@ -71,9 +71,11 @@ stop)
|
||||
cronset '保守模式守护进程'
|
||||
cronset '运行时每'
|
||||
cronset '流媒体预解析'
|
||||
#停止tg_bot
|
||||
. "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
|
||||
#多种方式结束进程
|
||||
if [ -f "$TMPDIR/shellcrash.pid" ];then
|
||||
kill -TERM "$(cat "$TMPDIR/shellcrash.pid")"
|
||||
kill -TERM "$(cat "$TMPDIR/shellcrash.pid")" 2>/dev/null
|
||||
rm -f "$TMPDIR/shellcrash.pid"
|
||||
stop_firewall
|
||||
elif [ "$USER" = "root" ] && grep -q 'systemd' /proc/1/comm; then
|
||||
|
||||
@@ -62,7 +62,10 @@ auto_start(){
|
||||
chmod 755 /etc/init.d/shellcrash
|
||||
}
|
||||
#初始化环境变量
|
||||
grep -q '^export CRASHDIR=' '/etc/profile' && . "$CRASHDIR"/libs/set_profile.sh && set_profile '/etc/profile'
|
||||
grep -q '^export CRASHDIR=' '/etc/profile' || {
|
||||
. "$CRASHDIR"/libs/set_profile.sh
|
||||
set_profile '/etc/profile'
|
||||
}
|
||||
#启动服务
|
||||
if [ ! -f "$CRASHDIR"/.dis_startup ]; then
|
||||
#AX6S/AX6000修复tun功能
|
||||
|
||||
Reference in New Issue
Block a user