mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-02-01 07:10:40 +03:00
Compare commits
3 Commits
v72.202601
...
zap1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80d5e49bcc | ||
|
|
4cccfa7917 | ||
|
|
2e4b55def5 |
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -155,7 +155,6 @@ jobs:
|
||||
- mipsel_24kc_24kf
|
||||
- mipsel_74kc
|
||||
- mipsel_mips32
|
||||
- riscv64_riscv64
|
||||
- riscv64_generic
|
||||
- x86_64
|
||||
isTestOrFake:
|
||||
@@ -165,8 +164,6 @@ jobs:
|
||||
arch: arm_cortex-a9_vfpv3-d16
|
||||
- branch: ${{ needs.var.outputs.APK_BRANCH }}
|
||||
arch: mips_4kec
|
||||
- branch: ${{ needs.var.outputs.APK_BRANCH }}
|
||||
arch: riscv64_riscv64
|
||||
- branch: ${{ needs.var.outputs.IPK_BRANCH }}
|
||||
arch: riscv64_generic
|
||||
- { isTestOrFake: true }
|
||||
|
||||
@@ -809,11 +809,23 @@ return baseclass.extend({
|
||||
{
|
||||
ticks += 1;
|
||||
try {
|
||||
if (retCode < 0) {
|
||||
let rc = await fs.exec('/bin/cat', [ rcFile ], null);
|
||||
if (rc.code != 0) {
|
||||
fixLogEnd();
|
||||
resolve(callback.call(ctx, 542, 'ERROR: cannot read file "' + rcFile + '"'));
|
||||
return;
|
||||
}
|
||||
if (rc.stdout) {
|
||||
retCode = parseInt(rc.stdout.trim(), 10);
|
||||
}
|
||||
}
|
||||
let res = await fs.exec('/bin/cat', [ logFile ], null);
|
||||
if (res.code != 0) {
|
||||
if (ticks > 1) {
|
||||
console.log('ERROR: execAndRead: '+JSON.stringify(opt_list));
|
||||
resolve(callback.call(ctx, 541, 'ERROR: Failed on read process log: code = ' + res.code));
|
||||
fixLogEnd();
|
||||
resolve(callback.call(ctx, 546, 'ERROR: Failed on read process log: code = ' + res.code));
|
||||
return;
|
||||
}
|
||||
setTimeout(epoll, 500);
|
||||
@@ -831,17 +843,6 @@ return baseclass.extend({
|
||||
appendLog(log, '');
|
||||
lastLen = res.stdout.length;
|
||||
}
|
||||
if (retCode < 0) {
|
||||
let rc = await fs.exec('/bin/cat', [ rcFile ], null);
|
||||
if (rc.code != 0) {
|
||||
fixLogEnd();
|
||||
resolve(callback.call(ctx, 545, 'ERROR: cannot read file "' + rcFile + '"'));
|
||||
return;
|
||||
}
|
||||
if (rc.stdout) {
|
||||
retCode = parseInt(rc.stdout.trim(), 10);
|
||||
}
|
||||
}
|
||||
if (retCode >= 0) {
|
||||
fixLogEnd();
|
||||
if (retCode == 0 && res.stdout) {
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 remittor
|
||||
PID_FILE=/tmp/zapret-script-exec.pid
|
||||
[ -f $PID_FILE ] && exit 70
|
||||
if [ -f $PID_FILE ]; then
|
||||
echo "ERROR: file $PID_FILE already exists!" | awk 'NR==1'
|
||||
exit 70
|
||||
fi
|
||||
LOG_FILE=$1
|
||||
RC_FILE=$1.rc
|
||||
SH_FILE=$2
|
||||
shift 2
|
||||
[ ! -f $SH_FILE ] && exit 71
|
||||
if [ ! -f $SH_FILE ]; then
|
||||
echo "ERROR: script $SH_FILE not found!" | awk 'NR==1'
|
||||
exit 71
|
||||
fi
|
||||
: > $LOG_FILE
|
||||
: > $RC_FILE
|
||||
start-stop-daemon -S -b -p $PID_FILE -x /bin/sh -- -c '
|
||||
@@ -16,7 +22,13 @@ start-stop-daemon -S -b -p $PID_FILE -x /bin/sh -- -c '
|
||||
shift 3
|
||||
sh $SH_FILE "$@" > $LOG_FILE 2>&1
|
||||
RET_CODE=$?
|
||||
sleep 1
|
||||
wc -l $LOG_FILE >/dev/null
|
||||
echo $RET_CODE > $RC_FILE
|
||||
' sh $LOG_FILE $RC_FILE $SH_FILE "$@"
|
||||
RET_CODE=$?
|
||||
if [ $RET_CODE != 0 ]; then
|
||||
echo "ERROR: script $SH_FILE not executed! ret_code = $RET_CODE" | awk 'NR==1'
|
||||
exit $RET_CODE
|
||||
fi
|
||||
echo "Script $SH_FILE running..." | awk 'NR==1'
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user