mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Set services as enabled in omr-schedule services script
This commit is contained in:
parent
93ec83c111
commit
d4e7a680f1
1 changed files with 7 additions and 2 deletions
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
|
@ -94,11 +95,13 @@ fi
|
||||||
|
|
||||||
if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
|
if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
|
||||||
_log "Can't find rpcd, restart it..."
|
_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
|
/etc/init.d/rpcd restart >/dev/null 2>&1
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
if [ "$(pgrep dbus)" = "" ] && [ -f /etc/init.d/dbus ]; then
|
if [ "$(pgrep dbus)" = "" ] && [ -f /etc/init.d/dbus ]; then
|
||||||
_log "Can't find dbus, restart it..."
|
_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
|
/etc/init.d/dbus restart >/dev/null 2>&1
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
@ -123,6 +126,7 @@ if [ "$(uci -q get openmptcprouter.settings.disable_modemmanager)" != "1" ]; the
|
||||||
# /etc/init.d/modemmanager stop >/dev/null 2>&1
|
# /etc/init.d/modemmanager stop >/dev/null 2>&1
|
||||||
# sleep 5
|
# sleep 5
|
||||||
fi
|
fi
|
||||||
|
/etc/init.d/modemmanager enable >/dev/null 2>&1
|
||||||
fi
|
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
|
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..."
|
_log "Can't find omr-tracker-v2ray, restart omr-tracker..."
|
||||||
|
@ -150,6 +154,7 @@ restart_omrtracker() {
|
||||||
config_get ifenabled "$1" auto
|
config_get ifenabled "$1" auto
|
||||||
[ -z "$multipath" ] || [ "$multipath" = "off" ] && return
|
[ -z "$multipath" ] || [ "$multipath" = "off" ] && return
|
||||||
[ "$ifenabled" = "0" ] && return
|
[ "$ifenabled" = "0" ] && return
|
||||||
|
/etc/init.d/omr-tracker enable
|
||||||
/etc/init.d/omr-tracker start_interface "$1"
|
/etc/init.d/omr-tracker start_interface "$1"
|
||||||
sleep 10
|
sleep 10
|
||||||
}
|
}
|
||||||
|
@ -244,7 +249,7 @@ if [ -n "$(logread | tail -n 2 | grep 'Ring expansion failed')" ]; then
|
||||||
echo 1 > /sys/bus/pci/rescan
|
echo 1 > /sys/bus/pci/rescan
|
||||||
fi
|
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..."
|
_log "Can't find omr-bypass rules, restart omr-bypass..."
|
||||||
/etc/init.d/omr-bypass start >/dev/null 2>&1
|
/etc/init.d/omr-bypass start >/dev/null 2>&1
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue