Koozali.org: home of the SME Server

Automatic monitor poweroff after one minute

Offline Igi2003

  • *****
  • 226
  • +0/-0
Automatic monitor poweroff after one minute
« on: June 22, 2010, 01:49:19 PM »
Hello SME World,
I found an answer to poweroff monitor after one minute. The SME only blank screen after few minutes. If someone has an Monitor connected to his server/testserver, so he had to Poweroff manually. With this easy script and an automatic run on bootup, the monitor goes into sleep mode after one minute.

Create an Shell file with "touch /etc/init.d/monitor_poweroff.sh" and make tihs executable with "chmod +x /etc/init.d/monitor_poweroff.sh"
Them open the file with vi oder mcedit or winscp and insert this code and save.
Code: [Select]
#!/bin/sh

for n in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
    if test -c /dev/tty$n ; then
            setterm -blank 1 -powersave powerdown -powerdown 2 > /dev/tty$n ;
    else
echo "Device node of TTY $n is bad.";
    fi
done


Create an Symlink with "ln -s /etc/init.d/monitor_poweroff.sh /etc/rc7.d/S99monitor_poweroff"

After reboot the monitor goes automatic poweroff.

Igi