#!/bin/sh

# Purpose: provide shortcut command to system init scripts
#       in /etc/init.d
#
# Note: I would prefer this to be a shell alias rather than a script.
#  However, aliases won't expand command line parameters.

# echo "command = /etc/init.d/$1 $0"
CMD=`echo $0 | cut -f5 -d/`
# echo "CMD = $CMD"
/etc/init.d/$1 $CMD

exit 0
# All done

# This doesn't work, as parm $0 includes the symlink path
# /etc/init.d/"$1 $0"

# The brute force method follows:
if [ $0 = 'stop' ] ; then
   /etc/init.d/$1 stop
elif [ $0 = 'restart' ] ; then
   /etc/init.d/$1 restart
else
   /etc/init.d/$1 start
fi

