#!/bin/sh # Figure out the actual command location TT_COMMAND="" COMMAND=${0##*/} for x in $(type -ap $COMMAND) do if [ ! $x -ef $0 ] then TT_COMMAND=$x break fi done if [ ! -n "$TT_COMMAND" ] then echo Cannot find ${COMMAND} exit 1 fi # If the user is root, no need to call the wrapper command if [ $UID == 0 ] then exec $TT_COMMAND "$@" fi # If wrapper is not active, no need to call the wrapper command if [ "x$TT_WRAPPER" != "xtrue" ] then exec $TT_COMMAND "$@" fi # Export the actual command for the wrapper script export TT_COMMAND ${COMMAND}_ "$@"