summary refs log tree commit diff
path: root/ssh-command.sh
blob: 3a24f68bb5810008e3f8806469f6bdb4e08b1ff1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -e -u

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