fix init script

- to add newline to [OK]
- to ignore 'config file testing succeeded' output of slaptest
This commit is contained in:
Jan Šafránek 2008-01-14 10:10:51 +00:00
parent 01e94086a8
commit 808537b99d
1 changed files with 8 additions and 3 deletions

View File

@ -125,10 +125,13 @@ function configtest() {
# Check the configuration file.
slaptestout=`/sbin/runuser -m -s "$slaptest" -- "$user" $slaptestflags 2>&1`
slaptestexit=$?
# slaptestout=`echo $slaptestout 2>/dev/null | grep -v "config file testing succeeded"`
# print warning if slaptest passed but reports some problems
if test $slaptestexit == 0 -a -n "$slaptestout" ; then
echo -n $"Checking configuration files for $prog: " ; warning ; echo
echo "$slaptestout"
if test $slaptestexit == 0 ; then
if echo "$slaptestout" | grep -v "config file testing succeeded" >/dev/null ; then
echo -n $"Checking configuration files for $prog: " ; warning ; echo
echo "$slaptestout"
fi
fi
# report error if configuration file is wrong
if test $slaptestexit != 0 ; then
@ -166,6 +169,7 @@ function start() {
daemon --check=$prog ${slapd} -h "\"$harg\"" -u ${user} $OPTIONS $SLAPD_OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldap
echo
return $RETVAL
}
@ -176,6 +180,7 @@ function stop() {
killproc ${slapd}
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ldap /var/run/slapd.args
echo
return $RETVAL
}