#!/bin/sh
# Copyright 2010 Novell, Inc.
# Author: Peter Bowen <pzb@novell.com> as a work made for hire.
#
# This work is licensed under the 
# Creative Commons Attribution-ShareAlike 3.0 Unported License. 
# To view a copy of this license, visit 
# http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to 
# Creative Commons, 171 Second Street, Suite 300, 
# San Francisco, California, 94105, USA.
#
# /etc/init.d/sces-client
#
#   and it's symbolic link
#
# /usr/sbin/rcsces-client
#
# chkconfig: 345 90 10
# description: Activate against SCES on boot.
#
### BEGIN INIT INFO
# Provides:       sces-client
# Required-Start: $network $remote_fs $syslog
# Should-Start:
# Required-Stop: $null
# Should-Stop:
# Default-Start:  3 4 5
# Default-Stop: 
# Description:    Activate against SCES on boot
# Short-Description: Activate against SCES
# X-UnitedLinux-Default-Enabled: yes
### END INIT INFO

. /etc/rc.status

# First reset status of this service
rc_reset

# We need the etc settings directory
if [ ! -d /etc/sces ]; then
    mkdir -p /etc/sces
fi

case "$1" in
    start)
        echo "Activating instace..."
        sces-activate
        rc_status -v
        ;;
    stop)
        echo "Deactivating instace..."
        sces-deactivate
        rc_status -v
        ;;
    try-restart)
        $0 status >/dev/null &&  $0 restart
        rc_status
        ;;
    reload)
        ;;
    restart)
        $0 stop
        $0 start
        rc_status
        ;;
    *)
        echo "Usage: $0 {start|stop|try-restart|restart}"
        exit 1
        ;;
esac
rc_exit

