diff options
author | June McEnroe <programble@gmail.com> | 2018-02-25 23:30:58 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-25 23:30:58 -0500 |
commit | 9f0221822c6f357a6ac012607c2ce7d8ca8df9b4 (patch) | |
tree | b8650ddaf049240c69cbd93926541889c561a76e /ssh-command.sh | |
parent | Switch back to static window sizing (diff) | |
download | stream-9f0221822c6f357a6ac012607c2ce7d8ca8df9b4.tar.gz stream-9f0221822c6f357a6ac012607c2ce7d8ca8df9b4.zip |
Add stop
Diffstat (limited to 'ssh-command.sh')
-rw-r--r-- | ssh-command.sh | 35 |
1 files changed, 20 insertions, 15 deletions
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##*/} ;; |