mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-01 22:28:54 +03:00
updater: Added retcode file (pid-file deleted)
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 remittor
|
||||
PID_FILE=/tmp/$1.pid
|
||||
LOG_FILE=/tmp/$1.log
|
||||
ERR_FILE=/tmp/$1.err
|
||||
LOG_FILE=$1
|
||||
RC_FILE=$1.rc
|
||||
shift 1
|
||||
: > $LOG_FILE
|
||||
: > $ERR_FILE
|
||||
: > $RC_FILE
|
||||
(
|
||||
exec </dev/null >/dev/null 2>&1
|
||||
"$@" >> $LOG_FILE 2>&1
|
||||
echo $? > "$ERR_FILE"
|
||||
RETCODE=$?
|
||||
sleep 1
|
||||
echo $RETCODE > $RC_FILE
|
||||
) &
|
||||
echo $! > $PID_FILE
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user