#!/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_rsyncDeltaImages

### BEGIN INIT INFO
# Provides:          sc_rsyncDeltaImages
# Required-Start:    $network $syslog sc_mkwsconfig
# Should-Start:      sshd $netdaemons sc_install
# Required-Stop:     $network
# Should-Stop:       $null
# Default-Start:     3 5
# Default-Stop:
# Description:       transfers (via rsync) delta images (if neccessary)
### 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 "Updating SmartClient delta images"
       if ! /usr/bin/sc_check_net 2> $ALL_LOG_DIR/$base; then
            rc_status -s
            rc_exit
       fi
       /usr/sbin/sc_rsyncDeltaImages.pl
       rc_status -v
       ;;
    stop)
       ;;
    status)
       # TODO: add status
       ;;
    *)
       echo "Usage: $0 {start|stop}"
       exit 1
       ;;
esac
rc_exit
