From: Ian Jackson Date: Sun, 9 Jun 2002 22:51:35 +0000 (+0000) Subject: add on-vc X-Git-Url: https://git.distorted.org.uk/~mdw/ircbot/commitdiff_plain/22368e4c2039ee2d245a9322ff9a5b68f3dc38d0?ds=sidebyside add on-vc --- diff --git a/on-vc.sh b/on-vc.sh new file mode 100755 index 0000000..9cd3ce8 --- /dev/null +++ b/on-vc.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# usage: +# .../on-vc.sh VC USERNAME SCRIPT +# must be invoked by full path to relevant directory +# where +# ttyVC is the relevant tty +# it should be owned by USERNAME +# ./SCRIPT is the startup script (`repeatedly.sh', `startup.sh', etc.) +# (in the directory whose fullpathname we're invoked with) + +set -e + +fail () { echo 2>&1 "$0: $1" } + +test $# = 3 || fail "usage: $0 VC USERNAME SCRIPT" +vc="$1" +username="$2" +script="$3" + +cd "$(dirname $0)" +test -L .tclshrc || fail "no .tclshrc symlink" +text -x "./$script" || fail "script not executable" + +openvt -c "$vc" -w -- \ + really -u "$username" screen ./"$script"