#! /bin/sh
# Copyright (c) 2001-2002 SuSE Linux AG, Germany.
# All rights reserved.
#
# Author: Joerg Steffens <joerg.steffens@dass-it.de>
#
# /etc/init.d/sc_install

### BEGIN INIT INFO
# Provides:          sc_install
# Required-Start:    $network $syslog sc_mkwsconfig
# Should-Start:      sshd xinetd
# Required-Stop:     $network
# Should-Stop:       $null
# Default-Start:     3 5
# Default-Stop:
# Description:       installs additional rpm packages as defined in LDAP
### 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 "installing and removing software packages via sc_install"
        if ! /usr/bin/sc_check_net 2> $ALL_LOG_DIR/$base; then
            rc_status -s
            rc_exit
        fi
        /usr/sbin/sc_install.pl
        rc_status -v
        ;;
    stop)
       #rc_status -v
       ;;
    status)
       # TODO: add status
       ;;
    *)
       echo "Usage: $0 {start|stop}"
       exit 1
       ;;
esac
rc_exit
