#!/bin/sh

# the following is the LSB init header see
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
#
### BEGIN INIT INFO
# Provides: disable-screensaver
# Default-Start: 3 4 5
# Short-Description: disable text-mode screensaver
# Description: This is a script to disable text-mode screensaver on console.
### END INIT INFO

# the following is chkconfig init header
#
# disable-screensaver:   disable text-mode screensaver
#
# chkconfig: 345 98 01
# description: This is a script to disable text-mode screensaver on console.
#

# Source function library.
. /etc/rc.d/init.d/functions

NAME=disable-screensaver
LC_ALL=C
RETVAL=0

# See how we were called.
case "$1" in
    start)
    	touch /var/lock/subsys/$NAME
    	setterm -blank 0 -powersave off -powerdown 0 \
    		</dev/console >/dev/console 2>&1  
	#echo -e '33[9;0]33[14;0]' > /dev/console
    	;;
    stop)
        stop
        rm -f /var/lock/subsys/$NAME
        ;;
    status)
    	status $NAME
        RETVAL=$?
        ;;
    *)
        echo $"Usage: $0 {start|stop|status}"
	exit 1
        ;;
esac
exit $RETVAL
