mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-02-01 15:20:45 +03:00
Compare commits
8 Commits
v0.9.20260
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbb1aadfef | ||
|
|
1f784b5773 | ||
|
|
d85c80504f | ||
|
|
cc90c8dace | ||
|
|
986b3a28b1 | ||
|
|
07f5b13f11 | ||
|
|
60044abbc0 | ||
|
|
01a1b8801d |
@@ -5,8 +5,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-zapret2
|
PKG_NAME:=luci-app-zapret2
|
||||||
PKG_VERSION:=0.9.20260130
|
PKG_VERSION:=0.9.20260131
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||||
|
|
||||||
|
|||||||
@@ -158,13 +158,17 @@ return baseclass.extend({
|
|||||||
E('br'), E('br'),
|
E('br'), E('br'),
|
||||||
this.logArea,
|
this.logArea,
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'right' }, [
|
E('div', { 'style': 'display:flex; justify-content:space-between; align-items:center; margin-top:1px;' }, [
|
||||||
this.btn_sitescheck,
|
E('div', { 'class': 'left' }, [
|
||||||
' ',
|
this.btn_sitescheck,
|
||||||
this.btn_dpicheck,
|
' ',
|
||||||
' ',
|
this.btn_dpicheck,
|
||||||
this.btn_cancel,
|
]),
|
||||||
])
|
E('div', { 'class': 'right' }, [
|
||||||
|
' ',
|
||||||
|
this.btn_cancel,
|
||||||
|
]),
|
||||||
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -175,6 +175,10 @@ return view.extend({
|
|||||||
|
|
||||||
statusPoll: function()
|
statusPoll: function()
|
||||||
{
|
{
|
||||||
|
if (tools.isModalActive()) {
|
||||||
|
this.POLL.running = false;
|
||||||
|
return; // not update page when any modal dialog is active
|
||||||
|
}
|
||||||
this.getAppStatus().then(
|
this.getAppStatus().then(
|
||||||
L.bind(this.setAppStatus, this)
|
L.bind(this.setAppStatus, this)
|
||||||
);
|
);
|
||||||
@@ -228,6 +232,7 @@ return view.extend({
|
|||||||
let cancel_button = E('button', {
|
let cancel_button = E('button', {
|
||||||
'class': btn_style_neutral,
|
'class': btn_style_neutral,
|
||||||
'click': ui.hideModal,
|
'click': ui.hideModal,
|
||||||
|
'class': btn_style_warning,
|
||||||
}, _('Cancel'));
|
}, _('Cancel'));
|
||||||
|
|
||||||
let resetcfg_btn = E('button', {
|
let resetcfg_btn = E('button', {
|
||||||
@@ -277,11 +282,14 @@ return view.extend({
|
|||||||
nfqws_strat,
|
nfqws_strat,
|
||||||
E('br'), E('br')
|
E('br'), E('br')
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'right' }, [
|
E('div', { 'style': 'display:flex; justify-content:space-between; align-items:center; margin-top:1px;' }, [
|
||||||
cancel_button,
|
E('div', { 'class': 'left' }, [
|
||||||
' ',
|
resetcfg_btn,
|
||||||
resetcfg_btn,
|
]),
|
||||||
])
|
E('div', { 'class': 'right' }, [
|
||||||
|
cancel_button,
|
||||||
|
]),
|
||||||
|
]),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -761,7 +761,12 @@ return baseclass.extend({
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
execAndRead: async function({ cmd = [ ], log = '', logArea = null, callback = null, ctx = null, hiderow = [ ], rpc_timeout = 5, rpc_root = false } = {})
|
isModalActive: function()
|
||||||
|
{
|
||||||
|
return document.body.classList.contains('modal-overlay-active');
|
||||||
|
},
|
||||||
|
|
||||||
|
execAndRead: async function({ cmd = [ ], log = '', logArea = null, callback = null, ctx = null, hiderow = [ ] } = {})
|
||||||
{
|
{
|
||||||
function appendLog(msg, end = '\n')
|
function appendLog(msg, end = '\n')
|
||||||
{
|
{
|
||||||
@@ -775,37 +780,81 @@ return baseclass.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let hide_rows = Array.isArray(hiderow) ? hiderow : [ hiderow ];
|
let hide_rows = Array.isArray(hiderow) ? hiderow : [ hiderow ];
|
||||||
let rpc_opt = { "timeout": rpc_timeout*1000 };
|
|
||||||
if (rpc_root) {
|
|
||||||
rpc_opt.uid = 0; // run under root
|
|
||||||
}
|
|
||||||
const logFile = log; // file for reading: '/tmp/zapret_pkg_install.log'
|
const logFile = log; // file for reading: '/tmp/zapret_pkg_install.log'
|
||||||
const rcFile = logFile + '.rc';
|
const rcFile = logFile + '.rc';
|
||||||
try {
|
try {
|
||||||
await fs.exec('/bin/busybox', [ 'rm', '-f', logFile + '*' ], null, rpc_opt);
|
await fs.exec('/bin/busybox', [ 'rm', '-f', logFile ], null);
|
||||||
appendLog('Output file cleared!');
|
await fs.exec('/bin/busybox', [ 'rm', '-f', rcFile ], null);
|
||||||
|
//appendLog('Output file cleared!');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return callback.call(ctx, 500, 'ERROR: Failed to clear output file');
|
return callback.call(ctx, 500, 'ERROR: Failed to clear output file');
|
||||||
}
|
}
|
||||||
|
let execRetCode = -1;
|
||||||
|
let opt_list = [ logFile ];
|
||||||
try {
|
try {
|
||||||
let opt_list = [ logFile ];
|
|
||||||
opt_list.push(...cmd);
|
opt_list.push(...cmd);
|
||||||
let res = await fs.exec(this.appDir+'/script-exec.sh', opt_list, null, rpc_opt);
|
//console.log('script-exec.sh ... '+JSON.stringify(opt_list));
|
||||||
if (res.code != 0) {
|
fs.exec(this.appDir+'/script-exec.sh', opt_list, null)
|
||||||
return callback.call(ctx, 525, 'ERROR: cannot run "' + cmd[0] + '" script! (error = ' + res.code + ')');
|
.then( (res) => {
|
||||||
}
|
if (execRetCode < 0) {
|
||||||
appendLog('Process started...');
|
execRetCode = res.code;
|
||||||
|
fixLogEnd();
|
||||||
|
if (res.code == 0) {
|
||||||
|
appendLog('Process started....');
|
||||||
|
} else {
|
||||||
|
if (res.stdout) appendLog(res.stdout);
|
||||||
|
appendLog('ERROR: process not executed! ret_code = '+res.code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch( (e) => {
|
||||||
|
console.log('ERROR: execAndRead: process not exec: '+e.message);
|
||||||
|
execRetCode = -100;
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return callback.call(ctx, 520, 'ERROR: Failed on execute process: ' + e.message);
|
return callback.call(ctx, 520, 'ERROR: Failed on execute process: ' + e.message);
|
||||||
}
|
}
|
||||||
let lastLen = 0;
|
let lastLen = 0;
|
||||||
let retCode = -1;
|
let retCode = -2; // rc file not found
|
||||||
return await new Promise(async (resolve, reject) => {
|
return await new Promise(async (resolve, reject) => {
|
||||||
|
let ticks = 0;
|
||||||
async function epoll()
|
async function epoll()
|
||||||
{
|
{
|
||||||
|
ticks += 1;
|
||||||
try {
|
try {
|
||||||
let res = await fs.exec('/bin/cat', [ logFile ], null, rpc_opt);
|
if (retCode < 0) {
|
||||||
if (res.stdout && res.stdout.length > lastLen) {
|
let rc = await fs.exec('/bin/cat', [ rcFile ], null);
|
||||||
|
if (rc.code != 0) {
|
||||||
|
if (ticks >= 2) {
|
||||||
|
console.log('ERROR: execAndRead: '+JSON.stringify(opt_list));
|
||||||
|
fixLogEnd();
|
||||||
|
resolve(callback.call(ctx, 542, 'ERROR: Failed on read process rc-file: code = ' + rc.code));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('WARN: execAndRead: read rc-file res.code = '+rc.code);
|
||||||
|
}
|
||||||
|
if (rc.code == 0) {
|
||||||
|
if (rc.stdout) {
|
||||||
|
retCode = parseInt(rc.stdout.trim(), 10);
|
||||||
|
} else {
|
||||||
|
retCode = -1; // rc file exists, but empty
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (retCode <= -2) {
|
||||||
|
setTimeout(epoll, 500);
|
||||||
|
return; // skip first step with error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let res = await fs.exec('/bin/cat', [ logFile ], null);
|
||||||
|
if (res.code != 0) {
|
||||||
|
fixLogEnd();
|
||||||
|
resolve(callback.call(ctx, 546, 'ERROR: Failed on read process log: code = ' + res.code));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (execRetCode < 0) {
|
||||||
|
execRetCode = 9999;
|
||||||
|
appendLog('Process started...');
|
||||||
|
}
|
||||||
|
if (res.code == 0 && res.stdout && res.stdout.length > lastLen) {
|
||||||
let log = res.stdout.slice(lastLen);
|
let log = res.stdout.slice(lastLen);
|
||||||
hide_rows.forEach(re => {
|
hide_rows.forEach(re => {
|
||||||
log = log.replace(re, '');
|
log = log.replace(re, '');
|
||||||
@@ -813,17 +862,6 @@ return baseclass.extend({
|
|||||||
appendLog(log, '');
|
appendLog(log, '');
|
||||||
lastLen = res.stdout.length;
|
lastLen = res.stdout.length;
|
||||||
}
|
}
|
||||||
if (retCode < 0) {
|
|
||||||
let rc = await fs.exec('/bin/cat', [ rcFile ], null, rpc_opt);
|
|
||||||
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) {
|
if (retCode >= 0) {
|
||||||
fixLogEnd();
|
fixLogEnd();
|
||||||
if (retCode == 0 && res.stdout) {
|
if (retCode == 0 && res.stdout) {
|
||||||
|
|||||||
@@ -201,13 +201,17 @@ return baseclass.extend({
|
|||||||
E('hr'),
|
E('hr'),
|
||||||
this.logArea,
|
this.logArea,
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'right' }, [
|
E('div', { 'style': 'display:flex; justify-content:space-between; align-items:center; margin-top:1px;' }, [
|
||||||
this.btn_check,
|
E('div', { 'class': 'left' }, [
|
||||||
' ',
|
this.btn_check,
|
||||||
this.btn_install,
|
' ',
|
||||||
' ',
|
this.btn_install,
|
||||||
this.btn_cancel,
|
]),
|
||||||
])
|
E('div', { 'class': 'right' }, [
|
||||||
|
' ',
|
||||||
|
this.btn_cancel,
|
||||||
|
]),
|
||||||
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zapret2
|
PKG_NAME:=zapret2
|
||||||
PKG_VERSION:=0.9.20260130
|
PKG_VERSION:=0.9.20260131
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_MAINTAINER:=bol-van
|
PKG_MAINTAINER:=bol-van
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
@@ -14,8 +14,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
|||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret2.git
|
PKG_SOURCE_URL:=https://github.com/bol-van/zapret2.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=27d387c76dd3a356a284b2875d5787a3b4d3cb4e
|
PKG_SOURCE_VERSION:=a531da39fd7cf9d4c5c9c6fcf33d76b1d930c0d5
|
||||||
PKG_SOURCE_DATE:=2026-01-30
|
PKG_SOURCE_DATE:=2026-01-31
|
||||||
|
|
||||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret2/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret2/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
@@ -53,6 +53,19 @@ else
|
|||||||
LUA_LIBRARY:=-L$(STAGING_DIR)/usr/lib -llua$(LUA_VER)
|
LUA_LIBRARY:=-L$(STAGING_DIR)/usr/lib -llua$(LUA_VER)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
UPX_VER:=5.1.0
|
||||||
|
UPX_URL:=https://github.com/upx/upx/releases/download/v$(UPX_VER)
|
||||||
|
UPX_URL_FILE:=upx-$(UPX_VER)-amd64_linux.tar.xz
|
||||||
|
UPX_TAR:=$(PKG_NAME)-$(UPX_URL_FILE)
|
||||||
|
UPX_DIR:=$(PKG_BUILD_DIR)/upx
|
||||||
|
UPX_BIN:=$(UPX_DIR)/upx
|
||||||
|
|
||||||
|
ifneq ($(filter mips64,$(ARCH)),)
|
||||||
|
USE_UPX := 0
|
||||||
|
else
|
||||||
|
USE_UPX := 1
|
||||||
|
endif
|
||||||
|
|
||||||
#TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
|
#TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
|
||||||
#TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
#TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||||
|
|
||||||
@@ -80,6 +93,14 @@ endef
|
|||||||
$(eval $(call Download,$(PKG_NAME)-luajit))
|
$(eval $(call Download,$(PKG_NAME)-luajit))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
define Download/$(PKG_NAME)-upx
|
||||||
|
FILE:=$(UPX_TAR)
|
||||||
|
URL:=$(UPX_URL)
|
||||||
|
URL_FILE:=$(UPX_URL_FILE)
|
||||||
|
HASH:=skip
|
||||||
|
endef
|
||||||
|
$(eval $(call Download,$(PKG_NAME)-upx))
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
$(Build/Prepare/Default)
|
$(Build/Prepare/Default)
|
||||||
rm -f $(PKG_BUILD_DIR)/$(MAKE_PATH)/nfqws2
|
rm -f $(PKG_BUILD_DIR)/$(MAKE_PATH)/nfqws2
|
||||||
@@ -97,6 +118,9 @@ define Build/Prepare
|
|||||||
tar -xzf "$(DL_DIR)/$(LUAJIT_TGZ)" --strip-components=1 -C "$(LUASRC_DIR)" ; \
|
tar -xzf "$(DL_DIR)/$(LUAJIT_TGZ)" --strip-components=1 -C "$(LUASRC_DIR)" ; \
|
||||||
rm -rf $(LUAOUT_DIR) ; \
|
rm -rf $(LUAOUT_DIR) ; \
|
||||||
fi
|
fi
|
||||||
|
rm -rf $(UPX_DIR)
|
||||||
|
mkdir -p $(UPX_DIR)
|
||||||
|
tar -xf "$(DL_DIR)/$(UPX_TAR)" --strip-components=1 -C "$(UPX_DIR)"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
#define Build/Configure
|
#define Build/Configure
|
||||||
@@ -135,6 +159,16 @@ define Build/Compile
|
|||||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(TARGET_CONFIGURE_OPTS) LUA_JIT=$(LUA_JIT) LUA_CFLAGS="$(LUA_INCLUDE)" LUA_LIB="$(LUA_LIBRARY)"
|
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(TARGET_CONFIGURE_OPTS) LUA_JIT=$(LUA_JIT) LUA_CFLAGS="$(LUA_INCLUDE)" LUA_LIB="$(LUA_LIBRARY)"
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR)/ip2net $(TARGET_CONFIGURE_OPTS)
|
$(MAKE) -C $(PKG_BUILD_DIR)/ip2net $(TARGET_CONFIGURE_OPTS)
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR)/mdig $(TARGET_CONFIGURE_OPTS)
|
$(MAKE) -C $(PKG_BUILD_DIR)/mdig $(TARGET_CONFIGURE_OPTS)
|
||||||
|
ifeq ($(USE_UPX),1)
|
||||||
|
@if [ -x "$(UPX_BIN)" ]; then \
|
||||||
|
echo "Packing nfqws2 with UPX"; \
|
||||||
|
$(UPX_BIN) --best --lzma $(PKG_BUILD_DIR)/$(MAKE_PATH)/nfqws2; \
|
||||||
|
else \
|
||||||
|
echo "WARNING: UPX not found, skipping packing"; \
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
@echo "Skipping UPX for $(ARCH)"
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ZAPRET_DIR := /opt/zapret2
|
ZAPRET_DIR := /opt/zapret2
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ TEST_SUITE='
|
|||||||
{ id: "US.AWS-01", provider: "🇺🇸 AWS", times: 1, url: "https://corp.kaltura.com/wp-content/cache/min/1/wp-content/themes/airfleet/dist/styles/theme.css" },
|
{ id: "US.AWS-01", provider: "🇺🇸 AWS", times: 1, url: "https://corp.kaltura.com/wp-content/cache/min/1/wp-content/themes/airfleet/dist/styles/theme.css" },
|
||||||
{ id: "US.GC-01", provider: "🇺🇸 Google Cloud", times: 1, url: "https://api.usercentrics.eu/gvl/v3/en.json" },
|
{ id: "US.GC-01", provider: "🇺🇸 Google Cloud", times: 1, url: "https://api.usercentrics.eu/gvl/v3/en.json" },
|
||||||
{ id: "US.FST-01", provider: "🇺🇸 Fastly", times: 1, url: "https://www.jetblue.com/footer/footer-element-es2015.js" },
|
{ id: "US.FST-01", provider: "🇺🇸 Fastly", times: 1, url: "https://www.jetblue.com/footer/footer-element-es2015.js" },
|
||||||
{ id: "CA.FST-01", provider: "🇨🇦 Fastly", times: 1, url: "https://www.cnn10.com/" },
|
{ id: "CA.FST-01", provider: "🇨🇦 Fastly", times: 1, url: "https://ssl.p.jwpcdn.com/player/v/8.40.5/bidding.js" },
|
||||||
{ id: "US.AKM-01", provider: "🇺🇸 Akamai", times: 1, url: "https://www.roxio.com/static/roxio/images/products/creator/nxt9/call-action-footer-bg.jpg" },
|
{ id: "US.AKM-01", provider: "🇺🇸 Akamai", times: 1, url: "https://www.roxio.com/static/roxio/images/products/creator/nxt9/call-action-footer-bg.jpg" },
|
||||||
{ id: "PL.AKM-01", provider: "🇵🇱 Akamai", times: 1, url: "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$" },
|
{ id: "PL.AKM-01", provider: "🇵🇱 Akamai", times: 1, url: "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$" },
|
||||||
{ id: "US.CDN77-01", provider: "🇺🇸 CDN77", times: 1, url: "https://cdn.eso.org/images/banner1920/eso2520a.jpg" },
|
{ id: "US.CDN77-01", provider: "🇺🇸 CDN77", times: 1, url: "https://cdn.eso.org/images/banner1920/eso2520a.jpg" },
|
||||||
|
|||||||
@@ -1,15 +1,37 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (c) 2024 remittor
|
# Copyright (c) 2024 remittor
|
||||||
|
PID_FILE=/tmp/zapret-script-exec.pid
|
||||||
|
if [ -f $PID_FILE ]; then
|
||||||
|
echo "ERROR: file $PID_FILE already exists!" | awk 'NR==1'
|
||||||
|
exit 70
|
||||||
|
fi
|
||||||
LOG_FILE=$1
|
LOG_FILE=$1
|
||||||
RC_FILE=$1.rc
|
RC_FILE=$1.rc
|
||||||
shift 1
|
SH_FILE=$2
|
||||||
: > $LOG_FILE
|
shift 2
|
||||||
: > $RC_FILE
|
if [ ! -e $SH_FILE ]; then
|
||||||
(
|
echo "ERROR: script $SH_FILE not found!" | awk 'NR==1'
|
||||||
exec </dev/null >/dev/null 2>&1
|
exit 71
|
||||||
"$@" >> $LOG_FILE 2>&1
|
fi
|
||||||
RETCODE=$?
|
if [ ! -x $SH_FILE ]; then
|
||||||
sleep 1
|
echo "ERROR: script $SH_FILE not Found!" | awk 'NR==1'
|
||||||
echo $RETCODE > $RC_FILE
|
exit 72
|
||||||
) &
|
fi
|
||||||
|
start-stop-daemon -S -b -p $PID_FILE -x /bin/sh -- -c '
|
||||||
|
LOG_FILE=$1
|
||||||
|
RC_FILE=$2
|
||||||
|
SH_FILE=$3
|
||||||
|
shift 3
|
||||||
|
printf "" > $LOG_FILE
|
||||||
|
printf "" > $RC_FILE
|
||||||
|
$SH_FILE "$@" >> $LOG_FILE 2>&1
|
||||||
|
RET_CODE=$?
|
||||||
|
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
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user