mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
Merge branch 'master' into dev
# Conflicts: # ShellCrash.tar.gz # bin/version # scripts/menus/5_task.sh # version
This commit is contained in:
@@ -33,14 +33,12 @@ if [ -n "$test" -o -n "$(pidof CrashCore)" ]; then
|
||||
sleep 5
|
||||
logger ShellCrash服务已启动!
|
||||
} &
|
||||
ckcmd mtd_storage.sh && mtd_storage.sh save >/dev/null 2>&1 & #Padavan保存/etc/storage
|
||||
ckcmd mtd_storage.sh && mtd_storage.sh save >/dev/null 2>&1 #Padavan保存/etc/storage
|
||||
#加载定时任务
|
||||
[ -s "$CRASHDIR"/task/cron ] && croncmd "$CRASHDIR"/task/cron
|
||||
[ -s "$CRASHDIR"/task/cron ] && cronadd "$CRASHDIR"/task/cron
|
||||
[ -s "$CRASHDIR"/task/running ] && {
|
||||
cronset '运行时每'
|
||||
while read line; do
|
||||
cronset '2fjdi124dd12s' "$line"
|
||||
done <"$CRASHDIR"/task/running
|
||||
cronadd "$CRASHDIR"/task/running
|
||||
}
|
||||
[ "$start_old" = "ON" ] && cronset '保守模式守护进程' "* * * * * /bin/sh $CRASHDIR/starts/start_legacy_wd.sh shellcrash #ShellCrash保守模式守护进程"
|
||||
#加载条件任务
|
||||
@@ -48,7 +46,7 @@ if [ -n "$test" -o -n "$(pidof CrashCore)" ]; then
|
||||
[ -s "$CRASHDIR"/task/affirewall -a -s /etc/init.d/firewall -a ! -f /etc/init.d/firewall.bak ] && {
|
||||
#注入防火墙
|
||||
line=$(grep -En "fw.* restart" /etc/init.d/firewall | cut -d ":" -f 1)
|
||||
sed -i.bak "${line}a\\. "$CRASHDIR"/task/affirewall" /etc/init.d/firewall
|
||||
sed -i.bak "${line}a\\. $CRASHDIR/task/affirewall" /etc/init.d/firewall
|
||||
line=$(grep -En "fw.* start" /etc/init.d/firewall | cut -d ":" -f 1)
|
||||
sed -i "${line}a\\. $CRASHDIR/task/affirewall" /etc/init.d/firewall
|
||||
} &
|
||||
|
||||
@@ -66,7 +66,7 @@ get_core_config() { #下载内核配置文件
|
||||
exit 1
|
||||
else
|
||||
retry=$((retry + 1))
|
||||
logger "配置文件获取失败!" 31
|
||||
logger "配置文件获取失败!" 31 off on
|
||||
if [ "$retry" = 1 ]; then
|
||||
echo -e "\033[32m尝试更新服务器列表并使用其他服务器获取配置!\033[0m"
|
||||
update_servers
|
||||
|
||||
@@ -23,7 +23,7 @@ fi
|
||||
#写入环境变量
|
||||
set_profile "$profile"
|
||||
#启动进程或删除守护进程
|
||||
if [ -f "$CRASHDIR"/.dis_startup ];then
|
||||
if [ -f "$CRASHDIR"/.dis_startup ] || [ -f "$CRASHDIR"/.start_error ];then
|
||||
cronset "保守模式守护进程"
|
||||
else
|
||||
"$CRASHDIR"/start.sh start
|
||||
|
||||
@@ -71,11 +71,11 @@ auto_start(){
|
||||
set_profile '/etc/profile'
|
||||
}
|
||||
#启动服务
|
||||
if [ ! -f "$CRASHDIR"/.dis_startup ]; then
|
||||
if [ ! -f "$CRASHDIR"/.dis_startup ] && [ ! -f "$CRASHDIR"/.start_error ]; then
|
||||
#AX6S/AX6000修复tun功能
|
||||
[ -s "$CRASHDIR"/tools/tun.ko ] && tunfix
|
||||
#小米7000/小米万兆修复tproxy
|
||||
[ -f /etc/init.d/qca-nss-ecm ] && [ "$redir_mod" = 'Tproxy' ] && tproxyfix
|
||||
[ -f /etc/init.d/qca-nss-ecm ] && echo "$redir_mod" | grep -q 'Tproxy' && tproxyfix
|
||||
#自动覆盖根证书文件
|
||||
[ -s "$CRASHDIR"/tools/ca-certificates.crt ] && cp -f "$CRASHDIR"/tools/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
#启动服务
|
||||
|
||||
@@ -4,7 +4,7 @@ PIDFILE="/tmp/ShellCrash/$1.pid"
|
||||
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
PID="$(cat "$PIDFILE")"
|
||||
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
|
||||
if [ -n "$PID" ] && [ -d "/proc/$PID" ]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user