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

Merge pull request #121 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-04-23 02:17:26 +08:00 committed by GitHub
commit e8a12deae8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -181,6 +181,10 @@ start_service() {
EOF
/etc/init.d/rpcd restart 2>&1 >/dev/null
fi
if [ "$(pgrep ModemManager)" = "" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(uci -q show network | grep modemmanager)" ]; then
_log "Can't find ModemManager, start it..."
/etc/init.d/modemmanager restart
fi
}
stop_service() {

View file

@ -5,7 +5,7 @@
################################################################################
# If there is no interface that use modemmanager, exit
[ -z "$(uci -q show network | grep modemmanager)" ] && exit
#[ -z "$(uci -q show network | grep modemmanager)" ] && exit
. /lib/functions.sh
. /lib/netifd/netifd-proto.sh
@ -23,7 +23,7 @@ MODEMMANAGER_EVENTS_CACHE="${MODEMMANAGER_RUNDIR}/events.cache"
# Common logging
mm_log() {
logger -t "ModemManager" "hotplug: $*"
[ -n "$(uci -q show network | grep modemmanager)" ] && logger -t "ModemManager" "hotplug: $*"
}
################################################################################

View file

@ -1313,6 +1313,12 @@ if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
sleep 5
fi
if [ "$(pgrep ModemManager)" = "" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(uci -q show network | grep modemmanager)" ]; then
_log "Can't find ModemManager, restart it..."
/etc/init.d/modemmanager restart
sleep 5
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..."
/etc/init.d/omr-tracker restart