[freebsd] bei startscripten " -a not found"

k33n

knochenbrecher
hallo, ich hab ein problem mit ein paar start scripten.

und zwar wenn ich z.b. "/usr/local/etc/rc.d/radius.sh"
Code:
#!/bin/sh

# RADIUSD_FLAGS='-xxyzsf -l stdout'
RADIUSD_FLAGS=

if [ -r /etc/defaults/rc.conf ]; then
   . /etc/defaults/rc.conf
   source_rc_confs
elif [ -r /etc/rc.conf ]; then
   . /etc/rc.conf
fi

prog=$(realpath $0) || exit 1
dir=${prog%/*}
PREFIX=${dir%/etc/rc.d}

if [ ."$dir" = ."$prog" -o ."$PREFIX" = ."$dir" ]
then
   echo "$0: Cannot determine the PREFIX" >&2
   exit 1
fi

case $1 in
start)
   touch /var/run/radiusd.pid
   chown nobody:nobody /var/run/radiusd.pid

   "$PREFIX"/sbin/radiusd $RADIUSD_FLAGS && echo -n " radiusd"
   ;;
stop)
   killall radiusd && echo -n ' radiusd'
   ;;
*)
   echo "Usage: `basename $0` {start|stop}" >&2
   exit 64
   ;;
esac

exit 0

kommt:
test# /usr/local/etc/rc.d/radius.sh start
-a: not found

kann mich mal jemand in die richtung stossen, wo um gottes willen das -a herkommt?????


k33n
 
Das -a kommt sicherlich von einem [ expr1 -a expr2 ], wobei expr1 wohl nicht definiert ist. Da ein entsprechender Test nicht in dem Script vorkommt, muss es also an den rc.confs liegen, die ge-source-t werden. Am einfachsten kommst du dem ganzen wie folgt auf die Schliche:

/bin/sh -x /usr/local/etc/rc.d/radius.sh start
 
Zurück
Oben