diff options
author | June McEnroe <programble@gmail.com> | 2018-02-22 16:31:54 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-22 16:31:54 -0500 |
commit | cc9613adb303d8700a4237268643dbcb632a9166 (patch) | |
tree | 30e5b753e8e8bef7bf0aeb8733d0e5bd88427e2e | |
parent | Set ForceCommand ssh-command (diff) | |
download | stream-cc9613adb303d8700a4237268643dbcb632a9166.tar.gz stream-cc9613adb303d8700a4237268643dbcb632a9166.zip |
List streams if none given
-rw-r--r-- | ssh-command.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ssh-command.sh b/ssh-command.sh index 333ca44..3a24f68 100644 --- a/ssh-command.sh +++ b/ssh-command.sh @@ -1,9 +1,17 @@ #!/bin/sh set -e -u -set $SSH_ORIGINAL_COMMAND -case $1 in - view) exec view public/${2##*/} ;; - ingest) exec ingest private/${2##*/} ;; - *) exec view public/${1##*/} ;; -esac +if [ -z "${SSH_ORIGINAL_COMMAND:-}" ]; then + cd public + for id in *; do + echo "ssh -t stream@ascii.town $id" + done + exit +else + set $SSH_ORIGINAL_COMMAND + case $1 in + ingest) exec ingest private/${2##*/} ;; + view) exec view public/${2##*/} ;; + *) exec view public/${1##*/} ;; + esac +fi |