add ability to toggle tmux use

This commit is contained in:
Nils 2021-07-10 20:09:36 +02:00
parent 2754f57143
commit 609ef528ef
Signed by: byreqz
GPG Key ID: 396A62D7D436749E
3 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,7 @@ this is a dynamically built gotty container
- title - set application title (browser and tmux session title, def. gotty)
- pkgs - additional packages to install when the container is started (optional, def. none)
- command - the command to run (required, def. none/pfetch)
- use_tmux - either open a subshell for every page load (false) or just attach to a single shell started at the beginning (true) (optional, def. true)
## compose
this example can also be found in the repo
@ -44,6 +45,7 @@ services:
- title=1234
- pkgs=htop
- command=htop
- use_tmux=true
```

View File

@ -13,3 +13,4 @@ services:
- title=1234
- pkgs=htop
- command=htop
- use_tmux=true

4
run.sh
View File

@ -19,4 +19,8 @@ if [ -z "$command" ];then
command="curl -s https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch | ash && figlet no command set && read swag"
fi
if [ "$use_tmux" == "false" ];then
/gotty -p "$port" $creds --title-format "$title" "$command"
else
/gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command"
fi