Skip to content

Commit 92dc36f

Browse files
authored
v3.0.1
CHANGED: service-event hook is more selective when it calls uiDivStats
2 parents 3d05b6d + 64a20fa commit 92dc36f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/240224b6b96543a782f176f2435ffa03)](https://www.codacy.com/app/jackyaz/uiDivStats?utm_source=github.com&utm_medium=referral&utm_content=jackyaz/uiDivStats&utm_campaign=Badge_Grade)
33
![Shellcheck](https://github.com/jackyaz/uiDivStats/actions/workflows/shellcheck.yml/badge.svg)
44

5-
## v3.0.0
6-
### Updated on 2021-06-07
5+
## v3.0.1
6+
### Updated on 2021-08-05
77
## About
88
A graphical representation of domain blocking performed by Diversion.
99

uiDivStats.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
### Start of script variables ###
2828
readonly SCRIPT_NAME="uiDivStats"
29-
readonly SCRIPT_VERSION="v3.0.0"
29+
readonly SCRIPT_VERSION="v3.0.1"
3030
SCRIPT_BRANCH="master"
3131
SCRIPT_REPO="https://raw.githubusercontent.com/jackyaz/$SCRIPT_NAME/$SCRIPT_BRANCH"
3232
readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d"
@@ -433,19 +433,19 @@ Auto_ServiceEvent(){
433433
create)
434434
if [ -f /jffs/scripts/service-event ]; then
435435
STARTUPLINECOUNT=$(grep -c '# '"$SCRIPT_NAME" /jffs/scripts/service-event)
436-
STARTUPLINECOUNTEX=$(grep -cx "/jffs/scripts/$SCRIPT_NAME service_event"' "$@" & # '"$SCRIPT_NAME" /jffs/scripts/service-event)
436+
STARTUPLINECOUNTEX=$(grep -cx 'if echo "$2" | /bin/grep -q "'"$SCRIPT_NAME"'"; then { /jffs/scripts/'"$SCRIPT_NAME"' service_event "$@" & }; fi # '"$SCRIPT_NAME" /jffs/scripts/service-event)
437437

438438
if [ "$STARTUPLINECOUNT" -gt 1 ] || { [ "$STARTUPLINECOUNTEX" -eq 0 ] && [ "$STARTUPLINECOUNT" -gt 0 ]; }; then
439439
sed -i -e '/# '"$SCRIPT_NAME"'/d' /jffs/scripts/service-event
440440
fi
441441

442442
if [ "$STARTUPLINECOUNTEX" -eq 0 ]; then
443-
echo "/jffs/scripts/$SCRIPT_NAME service_event"' "$@" & # '"$SCRIPT_NAME" >> /jffs/scripts/service-event
443+
echo 'if echo "$2" | /bin/grep -q "'"$SCRIPT_NAME"'"; then { /jffs/scripts/'"$SCRIPT_NAME"' service_event "$@" & }; fi # '"$SCRIPT_NAME" >> /jffs/scripts/service-event
444444
fi
445445
else
446446
echo "#!/bin/sh" > /jffs/scripts/service-event
447447
echo "" >> /jffs/scripts/service-event
448-
echo "/jffs/scripts/$SCRIPT_NAME service_event"' "$@" & # '"$SCRIPT_NAME" >> /jffs/scripts/service-event
448+
echo 'if echo "$2" | /bin/grep -q "'"$SCRIPT_NAME"'"; then { /jffs/scripts/'"$SCRIPT_NAME"' service_event "$@" & }; fi # '"$SCRIPT_NAME" >> /jffs/scripts/service-event
449449
chmod 0755 /jffs/scripts/service-event
450450
fi
451451
;;

0 commit comments

Comments
 (0)