Automatically shutdown unused computers
Par Guillaume Desmottes le dimanche, novembre 5 2006, 00:37 - Nerdzage - Lien permanent
For my job at the university I was asked to shutdown unused computers during the night (let's save some energy!). So i wrote halt-if-no-one, a little Python script that checks if there isn't any user logged and if not halt the system.
Sources with Debian packaging stuffs are available as a bazaar branch on http://cass.no-ip.com/~cassidy/repos/halt-if-no-one/.
bzr get http://cass.no-ip.com/~cassidy/repos/halt-if-no-one/
By default the script is called each hour between 8 PM and 8 AM but you can easily change it by editing /etc/cron.d/halt-if-no-one
Commentaires
Et hop ! Adopté :)
Par contre utiliser "usager=" le rend dépendant du français non ?
Plutôt un test sur le = ou directement un scanf %d ?
Bien vu !
J'ai corrigé ça.
Merci :)