Nieuws:

Ubuntu-NL weer online!

Na een periode van technische problemen en een overbelaste server zijn we eindelijk weer bereikbaar.
Samen met Hobbynet, onze sponsor en hostingpartner, hebben we een oplossing gevonden zodat alles weer soepel draait.

Bedankt voor jullie geduld en begrip. We hopen nu weer verder te gaan waar we gebleven waren.

Het team van Ubuntu-NL

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: [OPGELOST] automatisch afsluiten na 5 minuten  (gelezen 925 keer)

[OPGELOST] automatisch afsluiten na 5 minuten
« Gepost op: 2009/03/26, 13:41:34 »
Hallo,

is het mogelijk om een scrip/programma te maken dat mijn laptop automatisch afsluit (of X herstart) na 5 minuten?
Ik zou dit willen gebruiken voor een activiteit in de chiro, waarbij de leden 5 minuten op de computer mogen om iets op te zoeken, en daarna wordt hij afgesloten, zodat ze niet verder kunnen.

Als iemand mij hiermee kan helpen, zou dat zeer leuk zijn.

mvgr
Lennert
« Laatst bewerkt op: 2009/03/26, 14:59:39 door schwarzproductions »

Offline vanadium

  • Lid
Re: automatisch afsluiten na 5 minuten
« Reactie #1 Gepost op: 2009/03/26, 13:49:26 »
sleep <tijd> && telinit 0 &
toevoegen aan /etc/rc.local zou wel eens kunnen werken.

Een betere methode voor wat je wil zou automatisch "geforceerd" uitloggen zijn, maar ik weet niet zo vlug hoe dat kan.

Re: automatisch afsluiten na 5 minuten
« Reactie #2 Gepost op: 2009/03/26, 14:58:11 »
ik heb het gevonden:
sudo shutdown -P +5
En hiermee werkt het.

lennert@lennert-laptop:~$ shutdown --help
Gebruik: shutdown [OPTIE]... TIME [MESSAGE]
Bring the system down.

Opties:
  -r                          reboot after shutdown
  -h                          halt or power off after shutdown
  -H                          halt after shutdown (implies -h)
  -P                          power off after shutdown (implies -h)
  -c                          cancel a running shutdown
  -k                          only send warnings, don't shutdown
  -q, --quiet                 reduce output to errors only
  -v, --verbose               increase output to include informational messages
      --help                  display this help and exit
      --version               output version information and exit

TIME may have different formats, the most common is simply the word 'now' which
will bring the system down immediately.  Other valid formats are +m, where m is
the number of minutes to wait until shutting down and hh:mm which specifies the
time on the 24hr clock.

Logged in users are warned by a message sent to their terminal, you may include
an optional MESSAGE included with this.  Messages can be sent without actually
bringing the system down by using the -k option.

If TIME is given, the command will remain in the foreground until the shutdown
occurs.  It can be cancelled by Control-C, or by another user using the -c
option.

The system is brought down into maintenance (single-user) mode by default, you
can change this with either the -r or -h option which specify a reboot or
system halt respectively.  The -h option can be further modified with -H or -P
to specify whether to halt the system, or to power it off afterwards.  The
default is left up to the shutdown scripts.

Rapporteer fouten aan <upstart-devel@lists.ubuntu.com>.