mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-02-01 07:10:40 +03:00
updater: Fix error "XHR request timed out"
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 remittor
|
||||
PID_FILE=/tmp/zapret-script-exec.pid
|
||||
[ -f $PID_FILE ] && exit 70
|
||||
LOG_FILE=$1
|
||||
RC_FILE=$1.rc
|
||||
shift 1
|
||||
SH_FILE=$2
|
||||
shift 2
|
||||
[ ! -f $SH_FILE ] && exit 71
|
||||
: > $LOG_FILE
|
||||
: > $RC_FILE
|
||||
(
|
||||
exec </dev/null >/dev/null 2>&1
|
||||
"$@" >> $LOG_FILE 2>&1
|
||||
RETCODE=$?
|
||||
start-stop-daemon -S -b -p $PID_FILE -x /bin/sh -- -c '
|
||||
LOG_FILE=$1
|
||||
RC_FILE=$2
|
||||
SH_FILE=$3
|
||||
shift 3
|
||||
sh $SH_FILE "$@" > $LOG_FILE 2>&1
|
||||
RET_CODE=$?
|
||||
sleep 1
|
||||
echo $RETCODE > $RC_FILE
|
||||
) &
|
||||
echo $RET_CODE > $RC_FILE
|
||||
' sh $LOG_FILE $RC_FILE $SH_FILE "$@"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user