Skip to content

Instantly share code, notes, and snippets.

@n0ts
Last active January 4, 2016 10:59
Show Gist options
  • Save n0ts/8612119 to your computer and use it in GitHub Desktop.
Save n0ts/8612119 to your computer and use it in GitHub Desktop.
/etc/init.d/setterm
#!/bin/sh
### BEGIN INIT INFO
# Provides: setterm
# Required-Start:
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: disable console blanking
# Description: ref.
# http://superuser.com/questions/152347/change-linux-console-screen-blanking-behavior
# http://www.groupsrv.com/linux/about159299.html
### END INIT INFO
[ "$1" == "start" ] || exit 0 # only initialize everything when called as /etc/init.d/setterm start
for term in /dev/tty[0-9]*; do # select all ttyNN, but skip ttyS*
setterm -foreground green -store >$term <$term
setterm -background black -store >$term <$term
setterm -blank 0 -store >$term <$term
setterm -powersave off -store >$term <$term
setterm -powerdown 0 -store >$term <$term
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment