Monday, May 21, 2012

Power off machine after process is complete

This will check your machine for a specified process.
As soon as that process stops running , your machine will power off.

This is useful for example if you are using wget to download a large website.
you can then tell your machine to power off as soon as the website is finished being downloaded ie when wget is finished.

 while pgrep wget || sudo shutdown -P now; do sleep 1m; done

substitute wget for the process that you want to monitor.

No comments: