From a59175d2f9a12432abb6d0cd54dacafbd42db6e0 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 22 Feb 2018 15:46:44 -0500 Subject: Add command.sh --- .gitignore | 1 + Makefile | 6 +++--- command.sh | 9 +++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 command.sh 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 -- cgit 1.4.1