fix(persistence): invoke the installed script path literally

This commit is contained in:
2026-10-30 10:57:04 -03:00
parent 644ba62438
commit f4ff96bfd3
6 changed files with 67 additions and 16 deletions
+3 -7
View File
@@ -70,11 +70,7 @@ install_persist_launchdaemon() {
root="$(_persist_mount_root "$data_mount")"
local unleash_src
if [ -n "$SCRIPT_DIR" ]; then
unleash_src="$SCRIPT_DIR/unleash"
else
unleash_src="$(cd "$(dirname "$0")" && pwd)/unleash"
fi
unleash_src=$(_launchd_script_path)
step "Installing LaunchDaemon for boot-time persistence..."
@@ -93,8 +89,8 @@ install_persist_launchdaemon() {
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>${unleash_src} heal</string>
<string>${unleash_src}</string>
<string>heal</string>
</array>
<key>RunAtLoad</key>
<true/>
+7
View File
@@ -0,0 +1,7 @@
_launchd_script_path() {
local script_path="${SCRIPT_PATH:-}"
if [ -z "$script_path" ]; then
script_path="$(cd "$(dirname "$0")" && pwd)/$(basename "$0")"
fi
printf '%s' "$script_path" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g'
}