This is the script:
#!/bin/bash
setterm --blank 1 --powerdown 2
This is the service:
[Unit]
Description=Blank screen after 1 min and turn it off after 2 min. Any keypress will turn it back on.
After=ssh.service
[Service]
Type=oneshot
Environment=TERM=linux
StandardOutput=tty
TTYPath=/dev/console
ExecStart=/home/USER/.boot-scripts/screen-off.sh
[Install]
WantedBy=local.target
if I enable it and start it, it work but when I reboot the server nothing happened. If I verified the status of the service this is what I get:
● screen-off.service - Blank screen after 1 min and turn it off after 2 min. Any keypress will turn it back on.
Loaded: loaded (/etc/systemd/system/screen-off.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Any idea why it's not starting at boot and I have to do it manually?
Thanks