mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2025-12-31 03:48:17 +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
|
||||
|
||||
@@ -11,26 +11,26 @@ opt_update=
|
||||
opt_forced=
|
||||
opt_test=
|
||||
|
||||
while getopts "cu:pft" opt; do
|
||||
while getopts "cu:pft:" opt; do
|
||||
case $opt in
|
||||
c) opt_check=true;;
|
||||
p) opt_prerelease=true;;
|
||||
u) opt_update="$OPTARG";;
|
||||
f) opt_forced=true;;
|
||||
t) opt_test=true;;
|
||||
t) opt_test="$OPTARG";;
|
||||
esac
|
||||
done
|
||||
|
||||
ZAP_PKG_DIR=/tmp/zapret_pkg
|
||||
|
||||
if [ "$opt_test" = "true" ]; then
|
||||
if [ "$opt_test" != "" ]; then
|
||||
echo 1; sleep 2;
|
||||
echo 2; sleep 2;
|
||||
echo 3; sleep 2;
|
||||
echo ' * resolve_conffiles 123456'; sleep 1;
|
||||
echo 4; sleep 2;
|
||||
echo END
|
||||
return 0;
|
||||
return "$opt_test"
|
||||
fi
|
||||
|
||||
ZAP_CPU_ARCH=$(get_cpu_arch)
|
||||
|
||||
Reference in New Issue
Block a user