commit 8cdbdd3876755ab3e8eb77aaf6a39b6a863d6991
parent 9eb974aebc044a9e98a61603ce868798e4291968
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Fri, 23 Feb 2024 21:02:14 +0100
Create pthbs-enter conditionally when s6-envdir and execline is present
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/command/pthbs-enter-gen b/command/pthbs-enter-gen
@@ -22,9 +22,11 @@ fi
mkdir -p "$envdir"
printf '%s\n' "$envcommand" >"$envdir/PATH"
-cat >"$exe" <<EOF
+if test -x "$envcommand/execlineb" && test -x "$envcommand/s6-envdir"; then
+ cat >"$exe" <<EOF
#!$envcommand/execlineb -S0
"$envcommand/s6-envdir" "$envdir" "$envcommand/exec" \$@
EOF
-chmod +x "$exe"
-"$exe" true
+ chmod +x "$exe"
+ "$exe" true
+fi