gotty-docker/run.sh

29 lines
662 B
Bash
Raw Normal View History

2021-06-23 19:45:22 +00:00
#!/bin/sh
2021-06-22 21:55:32 +00:00
if [ -z "$port" ];then
port=8080
fi
if [ -n "$userpass" ];then
creds="-c "$userpass""
fi
2021-07-10 23:28:01 +00:00
if [ "$allow_write" == "true" ];then
allow_write="-w"
fi
2021-06-22 21:55:32 +00:00
if [ -z "$title" ];then
title=gotty
fi
if [ -n "$pkgs" ];then
apk update
apk add $pkgs
fi
if [ -z "$command" ];then
apk update
2021-06-23 19:45:22 +00:00
apk add figlet
command="curl -s https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch | ash && figlet no command set && read swag"
2021-06-22 21:55:32 +00:00
fi
2021-07-10 18:09:36 +00:00
if [ "$use_tmux" == "false" ];then
2021-07-10 23:28:01 +00:00
/gotty -p "$port" $allow_write $creds --title-format "$title" "$command"
2021-07-10 18:09:36 +00:00
else
2021-07-10 23:28:01 +00:00
/gotty -p "$port" $allow_write $creds --title-format "$title" tmux new-session -A -s "$title" "$command"
2021-07-10 18:09:36 +00:00
fi