mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 07:51:45 +00:00
~优化vmess入站功能,增加对自定义混淆host的配置存档
~优化Tailscale启用exitnode功能时的文字提示 ~增加对无法自动获取lan网段设备的提示信息 ~尝试修复部分设备定时任务报错 ~尝试调整tun模式下屏蔽quic的防火墙工作机制 ~修复重新进入新手引导会覆盖singbox内核为meta内核的bug ~修复公网防火墙放行端口在较新版本openwrt上未生效的bug
This commit is contained in:
@@ -1,24 +1,21 @@
|
||||
|
||||
crondir="$(crond -h 2>&1 | grep -oE 'Default:.*' | awk -F ":" '{print $2}')"
|
||||
[ ! -w "$crondir" ] && crondir="/etc/storage/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron"
|
||||
tmpcron="$TMPDIR"/cron_tmp
|
||||
|
||||
croncmd() { #定时任务工具
|
||||
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ]; then
|
||||
crontab "$1"
|
||||
else
|
||||
crondir="$(crond -h 2>&1 | grep -oE 'Default:.*' | awk -F ":" '{print $2}')"
|
||||
[ ! -w "$crondir" ] && crondir="/etc/storage/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron"
|
||||
if [ -w "$crondir" ]; then
|
||||
[ "$1" = "-l" ] && cat "$crondir"/"$USER" 2>/dev/null
|
||||
[ -f "$1" ] && cat "$1" >"$crondir"/"$USER"
|
||||
else
|
||||
echo "找不到可用的crond或者crontab应用!No available crond or crontab application can be found!"
|
||||
fi
|
||||
fi
|
||||
if [ -w "$crondir" ]; then
|
||||
[ "$1" = "-l" ] && cat "$crondir"/"$USER"
|
||||
[ -f "$1" ] && cat "$1" >"$crondir"/"$USER"
|
||||
else
|
||||
echo "找不到可用的crond或者crontab应用!No available crond or crontab application can be found!"
|
||||
fi
|
||||
}
|
||||
cronset() { #定时任务设置
|
||||
# 参数1代表要移除的关键字,参数2代表要添加的任务语句
|
||||
tmpcron="$TMPDIR"/cron_tmp
|
||||
croncmd -l >"$tmpcron" 2>/dev/null
|
||||
croncmd -l >"$tmpcron"
|
||||
sed -i "/$1/d" "$tmpcron"
|
||||
sed -i '/^$/d' "$tmpcron"
|
||||
echo "$2" >>"$tmpcron"
|
||||
|
||||
Reference in New Issue
Block a user