File smolt.init of Package smolt

#!/bin/bash
#
#     SUSE system startup script for smolt
#     Copyright (C) 1995--2007  Hendrik Vogelsang, SUSE / Novell Inc.
#          
#     This library is free software; you can redistribute it and/or modify it
#     under the terms of the GNU Lesser General Public License as published by
#     the Free Software Foundation; either version 2.1 of the License, or (at
#     your option) any later version.
#                             
#     This library is distributed in the hope that it will be useful, but
#     WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#     Lesser General Public License for more details.
#      
#     You should have received a copy of the GNU Lesser General Public
#     License along with this library; if not, write to the Free Software
#     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
#     USA
#
# /etc/init.d/smolt
#   and its symbolic link
# /usr/sbin/rcsmolt
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides:          smolt
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Enables automated checkins with smolt
# Description:       Enable monthly update of Smolt
### END INIT INFO

. /etc/rc.status

# Reset status of this service
rc_reset


lockfile=/var/lock/smolt

case "$1" in
  start)
  	echo -n $"Enabling monthly Smolt checkin: "
	touch "$lockfile"
	rc_status -v
	;;
  stop) 
	echo -n $"Disabling monthly Smolt update: "
	/bin/rm -f "$lockfile" 2> /dev/null
	rc_status -v
	;;
  restart)
	$0 stop
        $0 start
	;;
  reload)
	$0 restart
	;;
  status)
	if [ -f $lockfile ]; then
		echo $"Monthly smolt check-in is enabled."
		exit 0
		rc_status -v
	else
		echo $"Monthly smolt check-in is disabled."
		exit 3
		rc_status -v
	fi
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
        exit 1
        ;;

esac

exit $RETVAL
openSUSE Build Service is sponsored by