Close Terminal Command Delay

jared_f
Valued Contributor

Hi All,

We have a script that we locally install on each computer. Does anybody know how I can add a delay so the user has time to type in their password to mount network disks before terminal automatically closes?

Thanks.

1 ACCEPTED SOLUTION

jack_bishop
New Contributor III

Here's one way:

sleep 1800 && osascript -e 'tell application "Terminal" to quit'

The 1800 is seconds. Probably longer than you need, but you get the idea
Is there a reason you are using terminal for password input?

View solution in original post

3 REPLIES 3

dwandro92
Contributor III

Is this script triggered by an event (startup, login, etc.), running on a schedule, or is it manually executed? If you could provide an example of what the script is doing, it would be helpful.

roiegat
Contributor III

If your you using a script your could do it in bash using the sleep command. I sometimes use it to ensure the network connection is established before trying to do a network task.

jack_bishop
New Contributor III

Here's one way:

sleep 1800 && osascript -e 'tell application "Terminal" to quit'

The 1800 is seconds. Probably longer than you need, but you get the idea
Is there a reason you are using terminal for password input?