#!/bin/sh

if [ $# -lt 1 ]; then
  exit 1
fi

init_script=/etc/rc.d/init.d/$1

if [ ! -L $init_script ] && [ ! -e $init_script ]; then
  echo "$init_script not found or broken"
  exit 1
fi

if [ ! -x $init_script ]; then
  chmod 0754 $init_script
fi

logger "service: $@"

exec $init_script $2
