#! /bin/sh
# Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Kurt Garloff
# Please send feedback to http://www.suse.de/feedback/
#
# /etc/init.d/firstboot
#   and its symbolic link
# /(usr/)sbin/rcfirstboot
#
# Template system startup script for some example service/daemon firstboot
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
# 
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux (UL) based Linux distributions. If you want to base your 
# script on this template and ensure that it works on non UL based LSB 
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
#
### BEGIN INIT INFO
# Provides:          firstboot
# Required-Start:    $syslog $remote_fs
# Should-Start:      hwscan 
# Required-Stop:     
# Should-Stop: 
# Default-Start:     3 5
# Default-Stop:      
# Short-Description: YaST2 firstboot
# Description:       Start firstboot
### END INIT INFO
# 


# Read config	
#. $firstboot_CONFIG
if [ ! -f "/etc/reconfig_system" ]; then
	exit 0
fi


. /etc/rc.status

# Reset status of this service
rc_reset



case "$1" in
    start)
    echo -n "Configuring System for the first time.. "
	# LC_ALL is set to POSIX, so unset it so YaST2.Firstboot can correctly set the language
	unset LC_ALL
	## Start daemon with startproc(8). If this fails
	## the return value is set appropriately by startproc.
	/usr/lib/YaST2/startup/YaST2.Firstboot 2>/dev/null

	# Remember status and be verbose
	rc_status -v
	;;
    stop)
	;;
    *)
	echo "Usage: $0 {start}"
	exit 1
	;;
esac
rc_exit
