mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 05:35:13 +08:00
🐤 Sync 2026-10-03 00:12:36
This commit is contained in:
1 parent
ce3df55b24
commit
cb1d978497
58 files changed
+1627
-1018
No files matched your search
@@ -930,6 +930,8 @@ clean_crontab() {
|
||||
|
||||
start_crontab() {
|
||||
local update_loop
|
||||
local setsid_cmd=""
|
||||
command -v setsid >/dev/null 2>&1 && setsid_cmd="setsid "
|
||||
|
||||
if [ "$ENABLED_DEFAULT_ACL" = "1" ] || [ "$ENABLED_ACLS" = "1" ]; then
|
||||
local start_daemon=$(config_n_get @global_delay[0] start_daemon 0)
|
||||
@@ -976,7 +978,7 @@ start_crontab() {
|
||||
if [ "$week" = "8" ]; then
|
||||
update_loop=1
|
||||
else
|
||||
echo "$svr_t /etc/init.d/$CONFIG $action cron > /dev/null 2>&1 &" >>/etc/crontabs/root
|
||||
echo "$svr_t ${setsid_cmd}/etc/init.d/$CONFIG $action cron > /dev/null 2>&1 &" >>/etc/crontabs/root
|
||||
fi
|
||||
echolog "$logmsg"
|
||||
}
|
||||
@@ -996,7 +998,7 @@ start_crontab() {
|
||||
if [ "$rules_update_week_mode" = "8" ]; then
|
||||
update_loop=1
|
||||
else
|
||||
echo "$rule_t lua $APP_PATH/rule_update.lua log all cron > /dev/null 2>&1 &" >>/etc/crontabs/root
|
||||
echo "$rule_t ${setsid_cmd}lua $APP_PATH/rule_update.lua log all cron > /dev/null 2>&1 &" >>/etc/crontabs/root
|
||||
fi
|
||||
echolog "配置定时任务:自动更新规则。"
|
||||
fi
|
||||
@@ -1024,7 +1026,7 @@ start_crontab() {
|
||||
if [ "$sub_update_week_mode" = "8" ]; then
|
||||
update_loop=1
|
||||
else
|
||||
echo "$sub_t lua $APP_PATH/subscribe.lua start $cfgids cron > /dev/null 2>&1 &" >>/etc/crontabs/root
|
||||
echo "$sub_t ${setsid_cmd}lua $APP_PATH/subscribe.lua start $cfgids cron > /dev/null 2>&1 &" >>/etc/crontabs/root
|
||||
fi
|
||||
done
|
||||
rm -rf "$TMP_SUB_PATH"
|
||||
@@ -1050,6 +1052,22 @@ stop_crontab() {
|
||||
#echolog "清除定时执行命令。"
|
||||
}
|
||||
|
||||
restart_smartdns() {
|
||||
rm -rf /tmp/smartdns.cache
|
||||
/etc/init.d/smartdns reload >/dev/null 2>&1
|
||||
}
|
||||
|
||||
del_smartdns_conf() {
|
||||
command -v smartdns >/dev/null 2>&1 || return
|
||||
rm -rf "/tmp/etc/smartdns/${CONFIG}.conf"
|
||||
local custom_conf="/etc/smartdns/custom.conf"
|
||||
if [ -f "$custom_conf" ] && grep -q "${CONFIG}" "$custom_conf"; then
|
||||
sed -i "/${CONFIG}/d" "$custom_conf" >/dev/null 2>&1
|
||||
rm -rf /tmp/smartdns.cache
|
||||
/etc/init.d/smartdns reload >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
start_adblock() {
|
||||
[ "$(config_t_get global adblock 0)" != "1" ] && {
|
||||
[ -s $RULES_PATH/my_block_host ] && ln -sf $RULES_PATH/my_block_host $RULES_PATH/block_host || > $RULES_PATH/block_host
|
||||
@@ -1262,7 +1280,8 @@ start_dns() {
|
||||
-USE_DIRECT_LIST "${USE_DIRECT_LIST}" -USE_PROXY_LIST "${USE_PROXY_LIST}" -USE_BLOCK_LIST "${USE_BLOCK_LIST}" -USE_GFW_LIST "${USE_GFW_LIST}" -CHN_LIST "${CHN_LIST}" \
|
||||
-NODE ${NODE} -DEFAULT_PROXY_MODE "${TCP_PROXY_MODE}" -NO_PROXY_IPV6 ${FILTER_PROXY_IPV6:-0} -NFTFLAG ${nftflag:-0} \
|
||||
-SUBNET ${subnet_ip:-0} -NO_LOGIC_LOG ${NO_LOGIC_LOG:-0}
|
||||
source $APP_PATH/helper_smartdns.sh restart
|
||||
|
||||
restart_smartdns
|
||||
|
||||
USE_DEFAULT_DNS="chinadns_ng"
|
||||
else
|
||||
@@ -1746,7 +1765,7 @@ stop() {
|
||||
unset XRAY_LOCATION_ASSET
|
||||
unset SS_SYSTEM_DNS_RESOLVER_FORCE_BUILTIN
|
||||
stop_crontab $1
|
||||
source $APP_PATH/helper_smartdns.sh del
|
||||
del_smartdns_conf
|
||||
rm -rf $GLOBAL_DNSMASQ_CONF
|
||||
rm -rf $GLOBAL_DNSMASQ_CONF_PATH
|
||||
[ "1" = "1" ] && {
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
restart() {
|
||||
local no_log
|
||||
eval_set_val $@
|
||||
_LOG_FILE=$LOG_FILE
|
||||
[ -n "$no_log" ] && LOG_FILE="/dev/null"
|
||||
rm -rf /tmp/smartdns.cache
|
||||
/etc/init.d/smartdns reload >/dev/null 2>&1
|
||||
LOG_FILE=${_LOG_FILE}
|
||||
}
|
||||
|
||||
del() {
|
||||
rm -rf /tmp/etc/smartdns/passwall.conf
|
||||
sed -i "/passwall/d" /etc/smartdns/custom.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/smartdns.cache
|
||||
/etc/init.d/smartdns reload >/dev/null 2>&1
|
||||
}
|
||||
|
||||
arg1=$1
|
||||
shift
|
||||
case $arg1 in
|
||||
del)
|
||||
del $@
|
||||
;;
|
||||
restart)
|
||||
restart $@
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
Reference in new issue
Block a user