Batch script restart timer

septimamus

Estimable
Aug 20, 2014
2
0
4,510
0
i've been searching for days now, can't find it anywhere. Im looking for a way to reboot the computer using a batch script but with a timer which is set by the user. so if the user wants to reboot the computer in 5 minutes, the script should do that.

(sorry for the poor english.)
 

septimamus

Estimable
Aug 20, 2014
2
0
4,510
0


The 5 minutes is just for example. It's really just what the user wants. So if the user want to reboot in 6 minutes he typs "6" and the command should pick that up and reboot in 6 minutes. or 8 or 20 or two hours. It's just really about the imput of the user.
 

Someone Somewhere

Dignified
Moderator
Ah. I don't remember how to enter data into bash; I don't code for others much so tend to just use command line arguments.

A quick Google shows something along the lines of this: (UNTESTED!)
Code:
#!/bin/bash
echo "Enter time to wait (in minutes) before shutting down:"
read minutes
shutdown $minutes
 
Thread starter Similar threads Forum Replies Date
David___Only Apps General Discussion 0
S Apps General Discussion 4
M Apps General Discussion 3
D Apps General Discussion 2
N Apps General Discussion 1
NoctisLionward Apps General Discussion 2
malavena Apps General Discussion 3
Tom Waller Apps General Discussion 2
P Apps General Discussion 1
S Apps General Discussion 4
A Apps General Discussion 13
Z Apps General Discussion 1
P Apps General Discussion 7
G Apps General Discussion 0
T Apps General Discussion 5
SHADOWSTRIKE1 Apps General Discussion 3
S Apps General Discussion 3
R Apps General Discussion 3
D Apps General Discussion 1
V Apps General Discussion 2

ASK THE COMMUNITY

TRENDING THREADS