fix bogosity
[ircbot] / on-vc.sh
... / ...
CommitLineData
1#!/bin/sh
2# usage:
3# .../on-vc.sh VC SCRIPT
4# must be invoked by full path to relevant directory
5# where
6# ttyVC is the relevant tty which should have good permissions
7# ./SCRIPT is the startup script (`repeatedly.sh', `startup.sh', etc.)
8# (in the directory whose fullpathname we're invoked with)
9
10set -e
11
12fail () { echo 2>&1 "$0: $1"; exit 1; }
13
14test $# = 2 || fail "usage: $0 VC SCRIPT"
15vc="$1"
16script="$2"
17
18cd "$(dirname $0)"
19test -L .tclshrc || fail "no .tclshrc symlink"
20test -x "./$script" || fail "script not executable"
21
22openvt -f -c "$vc" -w -- screen ./"$script"