Monday, May 28, 2018

startup - Run two commands sequentially using crontab

My 3-year girl loves SuperTux. She can't control the mouse, so the game should run automatically on startup. After the game, the computer should shut down automatically.


However when I put the below command in "crontab -e":


@reboot env DISPLAY=:0.0 /usr/games/supertux2 && echo "PASSWORD" | sudo -S shutdown -h now


The first part runs the game on an old PC at boot time. I expected the second part of the command to turn off the computer when my girl exits the game but it isn't working.


Doesn't the chain-command A && B mean when the A finished, start B?


How can I automate the powering off computer when the game is closed?

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...