typo fixes
[ircbot] / on-vc.sh
CommitLineData
22368e4c
IJ
1#!/bin/sh
2# usage:
3# .../on-vc.sh VC USERNAME SCRIPT
4# must be invoked by full path to relevant directory
5# where
6# ttyVC is the relevant tty
7# it should be owned by USERNAME
8# ./SCRIPT is the startup script (`repeatedly.sh', `startup.sh', etc.)
9# (in the directory whose fullpathname we're invoked with)
10
11set -e
12
8630943d 13fail () { echo 2>&1 "$0: $1"; exit 1; }
22368e4c
IJ
14
15test $# = 3 || fail "usage: $0 VC USERNAME SCRIPT"
16vc="$1"
17username="$2"
18script="$3"
19
20cd "$(dirname $0)"
21test -L .tclshrc || fail "no .tclshrc symlink"
22text -x "./$script" || fail "script not executable"
23
24openvt -c "$vc" -w -- \
25 really -u "$username" screen ./"$script"