updater: Replace wget to curl and other fixes

This commit is contained in:
remittor
2025-12-18 09:19:08 +03:00
parent 252a7eab9d
commit 06f45e3fbb
4 changed files with 81 additions and 33 deletions

View File

@@ -1,12 +1,16 @@
#!/bin/sh
# Copyright (c) 2024 remittor
LOG_FILE=$1
PID_FILE=$2
shift 2
PID_FILE=/tmp/$1.pid
LOG_FILE=/tmp/$1.log
ERR_FILE=/tmp/$1.err
shift 1
: > $LOG_FILE
: > $ERR_FILE
(
exec </dev/null >/dev/null 2>&1
"$@" >> $LOG_FILE 2>&1
echo $? > "$ERR_FILE"
sleep 1
) &
echo $! > $PID_FILE
exit 0