#!/bin/sh # Figure out the actual command location TT_COMMAND="" COMMAND=${0##*/} for x in $(which -a $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 [ "`whoami`" = "root" ] 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}_ "$@"