diff --git a/Debian/Dockerfile b/Debian/Dockerfile new file mode 100644 index 0000000..7423e45 --- /dev/null +++ b/Debian/Dockerfile @@ -0,0 +1,11 @@ +FROM debian:sid + +RUN apt-get update +RUN apt-get install -y curl jq tmux +RUN curl -s https://api.github.com/repos/yudai/gotty/releases/latest | jq -r '.assets[].browser_download_url' | grep "gotty_linux_amd64.tar.gz" | xargs curl -L -o gotty_linux_amd64.tar.gz +RUN tar xvfz gotty_linux_amd64.tar.gz + +ENV TERM=xterm +COPY run-deb.sh ./run.sh +RUN chmod +x ./run.sh +ENTRYPOINT ["/run.sh"] diff --git a/Debian/run-deb.sh b/Debian/run-deb.sh new file mode 100644 index 0000000..d734863 --- /dev/null +++ b/Debian/run-deb.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -z "$port" ];then + port=8080 +fi +if [ -n "$userpass" ];then + creds="-c "$userpass"" +fi +if [ -z "$title" ];then + title=gotty +fi +if [ -n "$pkgs" ];then + apt-get update + apt-get install $pkgs +fi +if [ -z "$command" ];then + apt-get update + apt-get install figlet + command="curl -s https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch | bash && figlet no command set && read swag" +fi + +/gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command" +