From 9f0221822c6f357a6ac012607c2ce7d8ca8df9b4 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 25 Feb 2018 23:30:58 -0500 Subject: Add stop --- ssh-command.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'ssh-command.sh') diff --git a/ssh-command.sh b/ssh-command.sh index 4433717..3381d40 100644 --- a/ssh-command.sh +++ b/ssh-command.sh @@ -6,35 +6,39 @@ GIT_URL=git@ascii.town:stream.git welcome() { echo - echo 'Welcome to Twinch dot ptee vee!' + echo ' [~ The Stream at ASCII Town ~] ' echo - echo 'To view a public stream, run one of the following commands:' - echo - cd public for id in *; do echo " ssh -t $SSH_URL $id" done echo + echo ' [~ A Stream of Your Own ~] ' + echo + echo " ssh -t $SSH_URL start" } start() { - local id - id=$(setup $1) + local public private trash + read -p 'Public ID: ' -r public trash + public=${public##*/} + private=$(create $public) + echo "Private ID: $private" echo - echo 'Stream created!' + echo ' [~ Stop ~] ' echo - echo 'To view the stream, run:' + echo " ssh -t $SSH_URL stop $private" echo - echo " ssh -t $SSH_URL $1" + echo ' [~ View ~] ' echo - echo 'To broadcast to the stream, run:' + echo " ssh -t $SSH_URL $public" echo - echo " git clone $GIT_URL" - echo " cd stream" - echo " make ptee" - echo " ./ptee | ssh $SSH_URL ingest $id" + echo ' [~ Broadcast ~] ' echo + echo " git clone $GIT_URL" + echo ' cd stream' + echo ' make ptee' + echo " ./ptee | ssh $SSH_URL ingest $private" } if [ -z "${SSH_ORIGINAL_COMMAND:-}" ]; then @@ -43,7 +47,8 @@ if [ -z "${SSH_ORIGINAL_COMMAND:-}" ]; then else set $SSH_ORIGINAL_COMMAND case $1 in - start) start ${2##*/} ;; + start) start ;; + stop) exec destroy ${2##*/} ;; ingest) exec ingest private/${2##*/} ;; view) exec view public/${2##*/} ;; *) exec view public/${1##*/} ;; -- cgit 1.4.1