Automatically shutdown unused computers

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

1. Le lundi, novembre 6 2006, 18:03 par rangzen

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 ?

2. Le mardi, novembre 7 2006, 21:08 par Cassidy

Bien vu !
J'ai corrigé ça.

Merci :)