commit e4da83dbb7d3fbea2421d5a327780653f8d1b40c parent 66a7ae67b30b5b9d3ac99d1593748e1ec69a054f Author: Jan Pobrislo <ccx@te2000.cz> Date: Tue, 15 Apr 2025 03:18:27 +0000 Start container from app-terminal as needed Diffstat:
M | sbin/login.capability.app-terminal | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/sbin/login.capability.app-terminal b/sbin/login.capability.app-terminal @@ -86,9 +86,15 @@ check_command() { quoted_cmd="${(j: :)quoted}" } +ensure-container-started() { + [[ $1 == */* ]] && die "Invalid container name: ${(qqq)1}" + s6-svc -wU -T 4000 -o /run/service/container.$1 || die111 "failed to start container ${(qqq)1}" +} + main() { [[ $# == 1 ]] || die100 "usage: ${0:t} app" check_command $1 + ensure-container-started $container launch-urxvt $container $quoted_cmd } typeset -f -t main