diff options
-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 |