#!/bin/bash PID='' trap '[ -z $PID ] || kill -TERM $PID; exit' SIGTERM export PATH=/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/bin TEMP=$(getopt -o p: -n '/usr/local/bin/XT' -- "$@") if [ $? != 0 ] ; then echo "Usage: /usr/local/bin/XT [-p pidfile]" >&2 exit 1 fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while :; do case "$1" in -p) echo $$ >"$2"; shift 2;; --) shift; break;; esac done while :; do /usr/X11R6/bin/X :0 vt7 -indirect router /dev/null 2>&1 & PID=$! wait done