summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-22 15:46:44 -0500
committerJune McEnroe <programble@gmail.com>2018-02-22 15:46:44 -0500
commita59175d2f9a12432abb6d0cd54dacafbd42db6e0 (patch)
tree2fe759d7bbbb47543d0ff0076682611949973493
parentFactor out STREAM_SIZE for ingest and broadcast (diff)
downloadstream-a59175d2f9a12432abb6d0cd54dacafbd42db6e0.tar.gz
stream-a59175d2f9a12432abb6d0cd54dacafbd42db6e0.zip
Add command.sh
-rw-r--r--.gitignore1
-rw-r--r--Makefile6
-rw-r--r--command.sh9
3 files changed, 13 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 6dca280..4a491e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 broadcast
 chroot.tar
+command
 ingest
 root
 tags
diff --git a/Makefile b/Makefile
index 4050fdb..86e09de 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-BINS = broadcast ingest view
+BINS = broadcast command ingest view
 USER = stream
 
 CFLAGS += -Wall -Wextra -Wpedantic
@@ -9,7 +9,7 @@ all: tags $(BINS)
 tags: *.c
 	ctags -w *.c
 
-chroot.tar: ingest view
+chroot.tar: command ingest view
 	mkdir -p root
 	install -d -o root -g wheel \
 	    root/bin \
@@ -29,7 +29,7 @@ chroot.tar: ingest view
 	    root/lib
 	install -o root -g wheel -m 444 /usr/share/misc/termcap.db root/usr/share/misc
 	install -o root -g wheel -m 555 /bin/sh root/bin
-	install -o root -g wheel -m 555 ingest view root/bin
+	install -o root -g wheel -m 555 command ingest view root/bin
 	tar -c -f chroot.tar -C root bin home lib libexec usr
 
 clean:
diff --git a/command.sh b/command.sh
new file mode 100644
index 0000000..333ca44
--- /dev/null
+++ b/command.sh
@@ -0,0 +1,9 @@
+#!/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