#!/bin/sh
#
#Copyright (c) 2000 SuSE GmbH Nuernberg, Germany.  All rights reserved.
#
# Author: Ralf Doppelstein  <ralf.doppelstein@suse.de>, 2001
# /etc/init.d/sc_mkwsconfig

### BEGIN INIT INFO
# Provides:          sc_mkwsconfig
# Required-Start:    $network  $syslog $remote_fs
# Should-Start:      waitfornm
# Required-Stop:     $null
# Should-Stop:       $null
# Default-Start:     3 5
# Default-Stop:
# Description:       create local SmartClient config file 
### END INIT INFO

. /etc/rc.status
. /etc/smartclient/base

base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Reset status of this service
rc_reset
case "$1" in
    start)
        echo -n "Creating SmartClient workstation config file "
        if ! /usr/bin/sc_check_net 2> $ALL_LOG_DIR/$base; then
            rc_status -s
            rc_exit
        fi
        /usr/sbin/sc_mkwsconfig.pl 2> $ALL_LOG_DIR/$base
        rc_status -v
       ;;
    stop)
       ;;
    status)
       # TODO: add proper test
       test -r $ALL_LOG_DIR/$base
       ;;
    *)
       echo "Usage: $0 {start|stop}"
       exit 1
esac
rc_exit
