1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Set services as enabled in omr-schedule services script

This commit is contained in:
Ycarus (Yannick Chabanois) 2025-02-06 14:33:53 +01:00
parent 93ec83c111
commit d4e7a680f1

View file

@ -1,5 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
# Copyright (C) 2018-2025 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -94,11 +95,13 @@ fi
if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
_log "Can't find rpcd, restart it..."
/etc/init.d/rpcd enable >/dev/null 2>&1
/etc/init.d/rpcd restart >/dev/null 2>&1
sleep 5
fi
if [ "$(pgrep dbus)" = "" ] && [ -f /etc/init.d/dbus ]; then
_log "Can't find dbus, restart it..."
/etc/init.d/dbus enable >/dev/null 2>&1
/etc/init.d/dbus restart >/dev/null 2>&1
sleep 5
fi
@ -123,6 +126,7 @@ if [ "$(uci -q get openmptcprouter.settings.disable_modemmanager)" != "1" ]; the
# /etc/init.d/modemmanager stop >/dev/null 2>&1
# sleep 5
fi
/etc/init.d/modemmanager enable >/dev/null 2>&1
fi
if [ "$(uci -q get v2ray.main.enabled)" = "1" ] && [ -f /etc/init.d/v2ray ] && [ "$(pgrep -f omr-tracker-v2ray)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-v2ray, restart omr-tracker..."
@ -150,6 +154,7 @@ restart_omrtracker() {
config_get ifenabled "$1" auto
[ -z "$multipath" ] || [ "$multipath" = "off" ] && return
[ "$ifenabled" = "0" ] && return
/etc/init.d/omr-tracker enable
/etc/init.d/omr-tracker start_interface "$1"
sleep 10
}
@ -244,7 +249,7 @@ if [ -n "$(logread | tail -n 2 | grep 'Ring expansion failed')" ]; then
echo 1 > /sys/bus/pci/rescan
fi
if [ -f /etc/init.d/omr-bypass ] && [ -z "$(pgrep -f omr-bypass)" ] && (([ -e /usr/sbin/iptables-nft-save ] && [ "$(iptables-nft-save 2>/dev/null | grep omr-bypass)" = "" ]) || [ "$(iptables-save 2>/dev/null | grep omr-bypass)" = "" ]); then
if [ -f /etc/init.d/omr-bypass ] && [ -z "$(pgrep -f omr-bypass)" ] && ( ([ -e /usr/sbin/iptables-nft-save ] && [ "$(iptables-nft-save 2>/dev/null | grep omr-bypass)" = "" ]) || [ "$(iptables-save 2>/dev/null | grep omr-bypass)" = "" ]); then
_log "Can't find omr-bypass rules, restart omr-bypass..."
/etc/init.d/omr-bypass start >/dev/null 2>&1
sleep 5