mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 19:05:13 +08:00
🔥 Sync 2026-06-19 21:14:10
This commit is contained in:
1 parent
ce48633b46
commit
d92edece61
17 files changed
+533
-111
No files matched your search
@@ -1,28 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Refresh the apk/opkg index for the Updates view without holding the LuCI RPC
|
||||
# request open. The view watches STATUS and re-probes as soon as it reads done.
|
||||
# Background apk/opkg update for the Updates view. Returns at once; throttled.
|
||||
|
||||
LOCK=/tmp/luci-app-daede.idx.lock
|
||||
STATUS=/tmp/luci-app-daede.idx.status
|
||||
|
||||
if [ -f "$LOCK" ]; then
|
||||
mtime=$(date -r "$LOCK" +%s 2>/dev/null || echo 0)
|
||||
if [ "$(( $(date +%s) - mtime ))" -lt 90 ]; then
|
||||
[ -f "$STATUS" ] || printf '%s\n' done > "$STATUS"
|
||||
exit 0
|
||||
fi
|
||||
[ "$(( $(date +%s) - mtime ))" -lt 90 ] && exit 0
|
||||
fi
|
||||
: > "$LOCK"
|
||||
printf '%s\n' running > "$STATUS"
|
||||
|
||||
# -n: skip if a package op holds the shared apk lock (no need to refresh then)
|
||||
(
|
||||
# -n: skip if a package op holds the shared apk lock (no need to refresh then)
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
flock -n /tmp/luci-app-daede.apk.lock apk update
|
||||
elif command -v opkg >/dev/null 2>&1; then
|
||||
opkg update
|
||||
fi
|
||||
printf '%s\n' done > "$STATUS"
|
||||
) >/dev/null 2>&1 </dev/null &
|
||||
|
||||
exit 0
|
||||
@@ -20,7 +20,6 @@
|
||||
"/tmp/luci-app-daede.pkg-daed.log": [ "read" ],
|
||||
"/tmp/luci-app-daede.pkg-luci-app-daede.log": [ "read" ],
|
||||
"/tmp/luci-app-daede.backup.log": [ "read" ],
|
||||
"/tmp/luci-app-daede.idx.status": [ "read" ],
|
||||
"/bin/pidof dae": [ "exec" ],
|
||||
"/bin/pidof daed": [ "exec" ],
|
||||
"/usr/bin/dae validate -c /tmp/dae-validate.dae": [ "exec" ],
|
||||
|
||||
Reference in new issue
Block a user