KASM-1860 Add SHELL_EXEC environment variable for terminal image

- This command will be called when the terminal launches via .bashrc
This commit is contained in:
Justin Travis 2021-09-10 15:04:16 -04:00
parent f08dcab60e
commit 776e213c9f
2 changed files with 9 additions and 1 deletions

View File

@ -13,6 +13,13 @@ RUN apt-get update && apt-get install -y tmux screen nano dnsutils zip
RUN echo "set -g mouse on" > $HOME/.tmux.conf && chown 1000:1000 $HOME/.tmux.conf
### Update .bashrc to run an arbitrary command if specified as an environment variable
RUN echo "if [ ! -z \"\${SHELL_EXEC}\" ] && [ \"\${TERM}\" == \"xterm-256color\" ] ; \n\
then \n\
set +e \n\
eval \${SHELL_EXEC} \n\
fi " >> $HOME/.bashrc && chown 1000:1000 $HOME/.bashrc
### Install Ansible
COPY ./src/ubuntu/install/ansible $INST_SCRIPTS/ansible/
RUN bash $INST_SCRIPTS/ansible/install_ansible.sh && rm -rf $INST_SCRIPTS/ansible/

View File

@ -8,4 +8,5 @@ This Image contains a browser-accessible version of [xfce4-terminal](https://doc
# Environment Variables
* `APP_ARGS` - Additional arguments to pass to the application when launched.
* `TERMINAL_ARGS` - Additional arguments to pass to the application when launched.
* `SHELL_EXEC`- A command to run when the terminal starts