summary refs log tree commit diff
path: root/ssh-command.sh
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-22 16:31:54 -0500
committerJune McEnroe <programble@gmail.com>2018-02-22 16:31:54 -0500
commitcc9613adb303d8700a4237268643dbcb632a9166 (patch)
tree30e5b753e8e8bef7bf0aeb8733d0e5bd88427e2e /ssh-command.sh
parentSet ForceCommand ssh-command (diff)
downloadstream-cc9613adb303d8700a4237268643dbcb632a9166.tar.gz
stream-cc9613adb303d8700a4237268643dbcb632a9166.zip
List streams if none given
Diffstat (limited to 'ssh-command.sh')
-rw-r--r--ssh-command.sh20
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