#! /bin/sh
#
#

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
DAEMON="/usr/bin/welcome2l"
NAME="welcome2l"

test -f "$DAEMON" || exit 0

umask 022

# Read our defaults file
test -r /etc/default/welcome2l && . /etc/default/welcome2l

# Set default issue file
ISSUE_FILE="${ISSUE_FILE:-/etc/issue.welcome2l}"

set -e
umask 022

case "$1" in
  start|restart|force-reload)
	echo -n "Updating $ISSUE_FILE..."
	
 	$DAEMON ${OPTIONS:--getty} \
		"${MSG:+-msg$MSG}" \
		"${CPU:+-cpu$CPU}" > "$ISSUE_FILE"

	echo >> "$ISSUE_FILE"
	echo "done."
	;;
  stop)
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0
