blight-startup.tcl: Take personality config name as argument.
[ircbot] / on-vc.sh
CommitLineData
22368e4c
IJ
1#!/bin/sh
2# usage:
4afd32f1 3# .../on-vc.sh VC SCRIPT
22368e4c
IJ
4# must be invoked by full path to relevant directory
5# where
4afd32f1 6# ttyVC is the relevant tty which should have good permissions
22368e4c
IJ
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
5ae6ea62
IJ
12PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
13
8630943d 14fail () { echo 2>&1 "$0: $1"; exit 1; }
22368e4c 15
c3f0f552 16test $# -ge 2 || fail "usage: $0 VC SCRIPT [ARGS]"
22368e4c 17vc="$1"
4afd32f1 18script="$2"
c3f0f552 19shift; shift
22368e4c
IJ
20
21cd "$(dirname $0)"
22test -L .tclshrc || fail "no .tclshrc symlink"
b0ef02f8 23test -x "./$script" || fail "script not executable"
22368e4c 24
c3f0f552 25openvt -f -c "$vc" -w -- screen ./"$script" "$@"