fix(persistence): invoke the installed script path literally
This commit is contained in:
+3
-7
@@ -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/>
|
||||
|
||||
@@ -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/&/\&/g; s/</\</g; s/>/\>/g'
|
||||
}
|
||||
Reference in New Issue
Block a user