Skip to content

Commit 93138fe

Browse files
committed
**v2021.8.9.1 (202108091)**
- Rewritten daemon logic for better efficiency and reliability. - Updated documentation
1 parent 3d0dbe8 commit 93138fe

File tree

4 files changed

+36
-38
lines changed

4 files changed

+36
-38
lines changed

README.md

+9-17
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ Notes
137137
- All commands return either 0 (success/running) or 1 (failure/stopped).
138138
- djs-status prints the daemon's process ID (PID).
139139
- Special shell characters (e.g., "|", ";", "&") must be quoted or escaped. For the sake of simplicity and consistency, single-quote all arguments as a whole (e.g., djsc -a '2200 reboot -p').
140+
- PATH starts with /data/adb/vr25/bin:/dev/.vr25/busybox.
141+
This means schedules don't require additional busybox setup.
142+
The first directory holds user executables.
140143
```
141144

142145
---
@@ -178,23 +181,6 @@ Open issues on GitHub or contact the developer on Telegram/XDA (linked below). A
178181
## LATEST CHANGES
179182

180183

181-
**v2019.10.18 (201910180)**
182-
183-
- `: --boot` and `: --delete` flags
184-
- Attribute back-end files ownership to front-end app
185-
- Automatically copy installation log to <front-end app data>/files/logs/
186-
- Back-end can be upgraded from Magisk Manager, EX/FK Kernel Manager, and similar apps
187-
- `bundle.sh` - bundler for front-end app
188-
- `djs-version`: prints `versionCode` (integer)
189-
- Fixed schedule deletion and busybox handling issues
190-
- Flashable uninstaller: `/sdcard/djs-uninstaller.zip`
191-
- Major optimizations
192-
- Prioritize `nano -l` for text editing
193-
- Richer installation and initialization logs (/data/adb/djs-data/logs/)
194-
- Updated `build.sh` and documentation
195-
- Workaround for front-end autostart blockage (Magisk service.d script)
196-
197-
198184
**v2021.7.28 (202107280)**
199185

200186
- Fixed issues.
@@ -205,3 +191,9 @@ Open issues on GitHub or contact the developer on Telegram/XDA (linked below). A
205191
**v2021.8.2 (202108020)**
206192

207193
- Fixed AccA related issues.
194+
195+
196+
**v2021.8.9.1 (202108091)**
197+
198+
- Rewritten daemon logic for better efficiency and reliability.
199+
- Updated documentation

djs/djs-config.sh

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Usage: djsc|djs-config OPTION ARGS
5858
5959
-l|--list 'PATTERN' (default ".", meaning "all lines")
6060
e.g., djsc -l '^boot'
61+
62+
Note: PATH starts with /data/adb/vr25/bin:/dev/.vr25/busybox.
63+
This means schedules don't require additional busybox setup.
64+
The first directory holds user executables.
6165
CAT
6266
;;
6367
esac

djs/djs.sh

+21-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
exec > /dev/null 2>&1
88

99
set -u
10-
IFS=$(printf '\t\n')
1110
tmpDir=/dev/.vr25/djs
1211
execDir=/data/adb/vr25/djs
1312
config=${execDir}-data/config.txt
@@ -72,27 +71,30 @@ ln -sf $execDir/djs-version.sh /dev/djs-version
7271

7372

7473
# boot schedules
75-
for schedule in $(getv '^boot | : --boot'); do
76-
if ! grep -q "$schedule" $tmpDir/boot 2>/dev/null; then
77-
echo "$schedule" >> $tmpDir/boot
78-
(unset IFS; set +u; eval "$(echo "$schedule" | sed 's#^.... ##')" &) &
79-
fi
80-
done
74+
if [ ! -f $tmpDir/boot.sh ]; then
75+
echo "#!/system/bin/sh" > $tmpDir/boot.sh
76+
grep '^boot | : --boot' $config | sed 's/^.... //' >> $tmpDir/boot.sh
77+
echo 'exit $?' >> $tmpDir/boot.sh
78+
chmod u+x $tmpDir/boot.sh
79+
start-stop-daemon -bx $tmpDir/boot.sh -S --
80+
grep -q '^boot .* : --delete' $config && sed -i '/^boot .* : --delete/d' $config
81+
fi
8182

83+
# HH:MM schedules
8284
while :; do
83-
# HH:MM schedules
84-
for schedule in $(getv '^[0-2].[0-5][0-9]'); do
85-
if [ $(date +%H%M) -eq $(echo "$schedule" | grep -o '^.... ') ]; then
86-
if ! grep -q "$schedule" $tmpDir/HH:MM 2>/dev/null; then
87-
echo "$schedule" >> $tmpDir/HH:MM
88-
(unset IFS; set +u; eval "$(echo "$schedule" | sed 's#^.... ##')" &) &
89-
(sleep 60; sed -i "\#$schedule#d" $tmpDir/HH:MM &) &
90-
echo "$schedule" | grep -q ' : --delete' && sed -i "\#$schedule#d" $config
91-
sleep 1
92-
fi
93-
fi
85+
time=$(date +%H%M)
86+
echo "#!/system/bin/sh" > $tmpDir/${time}.sh
87+
if grep "^$time " $config | sed 's/^.... //' >> $tmpDir/${time}.sh; then
88+
echo 'rm $0' >> $tmpDir/${time}.sh
89+
echo 'exit $?' >> $tmpDir/${time}.sh
90+
chmod u+x $tmpDir/${time}.sh
91+
grep -q ' : --delete' $tmpDir/${time}.sh && sed -i "/^$time .* : --delete/d" $config
92+
start-stop-daemon -bx $tmpDir/${time}.sh -S --
93+
fi
94+
sleep 40
95+
while [ $(date +%H%M) -eq $time ]; do
96+
sleep 10
9497
done
95-
sleep 20
9698
done
9799

98100
exit $?

module.prop

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=djs
22
name=Daily Job Scheduler (DJS)
3-
version=2021.8.2
4-
versionCode=202108020
3+
version=v2021.8.9.1
4+
versionCode=202108091
55
author=VR25
66
description=Runs commands and scripts on boot and at HH:MM. Any root solution is supported. The installation is always "system-less", whether or not the system is rooted with Magisk.

0 commit comments

Comments
 (0)