update at 2026-03-15 14:54:51
This commit is contained in:
41
dash/staging/post-jailbreak-root/dashboard/debug-off.sh
Executable file
41
dash/staging/post-jailbreak-root/dashboard/debug-off.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# 持久关闭调试模式:修改 env.sh,恢复正常的省电挂起行为。
|
||||
set -eu
|
||||
|
||||
DIR="$(dirname "$0")"
|
||||
ENV_FILE="$DIR/local/env.sh"
|
||||
TMP_FILE="$DIR/local/env.sh.tmp"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "未找到配置文件:$ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 只替换目标配置,避免重复追加同一环境变量。
|
||||
awk '
|
||||
BEGIN {
|
||||
updated = 0
|
||||
}
|
||||
/^export DISABLE_SYSTEM_SUSPEND=/ {
|
||||
print "export DISABLE_SYSTEM_SUSPEND=false"
|
||||
updated = 1
|
||||
next
|
||||
}
|
||||
{
|
||||
print
|
||||
}
|
||||
END {
|
||||
if (!updated) {
|
||||
print "export DISABLE_SYSTEM_SUSPEND=false"
|
||||
}
|
||||
}
|
||||
' "$ENV_FILE" > "$TMP_FILE"
|
||||
|
||||
mv "$TMP_FILE" "$ENV_FILE"
|
||||
|
||||
# 已运行的 dashboard 进程不会重新读取 env.sh,切换后先停掉它,
|
||||
# 避免旧进程继续按旧配置运行。
|
||||
pkill -f "$DIR/dash.sh" 2>/dev/null || true
|
||||
|
||||
echo "已关闭 Dashboard 调试模式。当前 Dashboard 已停止,请重新启动 Kindle Dashboard。"
|
||||
41
dash/staging/post-jailbreak-root/dashboard/debug-on.sh
Executable file
41
dash/staging/post-jailbreak-root/dashboard/debug-on.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# 持久开启调试模式:修改 env.sh,让后续普通启动也不进入系统挂起。
|
||||
set -eu
|
||||
|
||||
DIR="$(dirname "$0")"
|
||||
ENV_FILE="$DIR/local/env.sh"
|
||||
TMP_FILE="$DIR/local/env.sh.tmp"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "未找到配置文件:$ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 只替换目标配置,避免重复追加同一环境变量。
|
||||
awk '
|
||||
BEGIN {
|
||||
updated = 0
|
||||
}
|
||||
/^export DISABLE_SYSTEM_SUSPEND=/ {
|
||||
print "export DISABLE_SYSTEM_SUSPEND=true"
|
||||
updated = 1
|
||||
next
|
||||
}
|
||||
{
|
||||
print
|
||||
}
|
||||
END {
|
||||
if (!updated) {
|
||||
print "export DISABLE_SYSTEM_SUSPEND=true"
|
||||
}
|
||||
}
|
||||
' "$ENV_FILE" > "$TMP_FILE"
|
||||
|
||||
mv "$TMP_FILE" "$ENV_FILE"
|
||||
|
||||
# 已运行的 dashboard 进程不会重新读取 env.sh,切换后先停掉它,
|
||||
# 避免旧进程继续按旧配置进入系统挂起。
|
||||
pkill -f "$DIR/dash.sh" 2>/dev/null || true
|
||||
|
||||
echo "已开启 Dashboard 调试模式。当前 Dashboard 已停止,请重新启动 Kindle Dashboard。"
|
||||
8
dash/staging/post-jailbreak-root/dashboard/start-debug.sh
Executable file
8
dash/staging/post-jailbreak-root/dashboard/start-debug.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# 调试启动脚本:强制关闭系统挂起,便于在 Kindle 上持续观察刷新效果。
|
||||
DIR="$(dirname "$0")"
|
||||
|
||||
export DISABLE_SYSTEM_SUSPEND=true
|
||||
|
||||
exec "$DIR/start.sh"
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"items": [
|
||||
{"name": "Kindle Dashboard", "action": "/mnt/us/dashboard/start.sh"}
|
||||
{"name": "Kindle Dashboard", "action": "/mnt/us/dashboard/start.sh"},
|
||||
{"name": "Dashboard Debug On", "action": "/mnt/us/dashboard/debug-on.sh"},
|
||||
{"name": "Dashboard Debug Off", "action": "/mnt/us/dashboard/debug-off.sh"}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user