mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -3,6 +3,7 @@ check_autostart(){
|
||||
[ ! -f "$CRASHDIR"/.dis_startup ] && return 0
|
||||
elif [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ]; then
|
||||
[ -n "$(find /etc/rc.d -name '*shellcrash')" ] && return 0
|
||||
[ ! -f "$CRASHDIR"/.dis_startup ] && return 0
|
||||
elif ckcmd systemctl; then
|
||||
[ "$(systemctl is-enabled shellcrash.service 2>&1)" = enabled ] && return 0
|
||||
elif grep -q 's6' /proc/1/comm; then
|
||||
|
||||
@@ -16,7 +16,7 @@ routing_mark=$((fwmark + 2))
|
||||
|
||||
[ -z "$dns_nameserver" ] && {
|
||||
dns_nameserver='223.5.5.5, 1.2.4.8'
|
||||
cat /proc/net/udp | grep -q '0035' && dns_nameserver='127.0.0.1'
|
||||
nslookup localhost 127.0.0.1 >/dev/null 2>&1 && dns_nameserver='127.0.0.1'
|
||||
}
|
||||
[ -z "$dns_fallback" ] && dns_fallback="1.1.1.1, 8.8.8.8"
|
||||
[ -z "$dns_resolver" ] && dns_resolver="223.5.5.5, 2400:3200::1"
|
||||
|
||||
@@ -10,17 +10,19 @@ touch "$tmpcron"
|
||||
cronadd() { #定时任务工具
|
||||
if crontab -h 2>&1 | grep -q '\-l'; then
|
||||
crontab "$1"
|
||||
else
|
||||
elif [ -f "$crondir/$USER" ];then
|
||||
cat "$1" >"$crondir"/"$USER" && cru a REFRESH "0 0 1 1 * /bin/true" 2>/dev/null
|
||||
else
|
||||
echo "找不到可用的crond或者crontab应用!No available crond or crontab application can be found!"
|
||||
fi
|
||||
}
|
||||
cronload() { #定时任务工具
|
||||
if [ -f "$crondir/$USER" ];then
|
||||
cat "$crondir"/"$USER" 2>/dev/null
|
||||
elif crontab -h 2>&1 | grep -q '\-l'; then
|
||||
if crontab -h 2>&1 | grep -q '\-l'; then
|
||||
crontab -l
|
||||
elif [ -f "$crondir/$USER" ];then
|
||||
cat "$crondir"/"$USER" 2>/dev/null
|
||||
else
|
||||
echo "找不到可用的crond或者crontab应用!No available crond or crontab application can be found!"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
cronset() { #定时任务设置
|
||||
|
||||
Reference in New Issue
Block a user