Results 1 to 7 of 7

Thread: shell script with an auto shutoff

  1. #1
    Join Date
    Aug 2009
    Beans
    91

    shell script with an auto shutoff

    I want to make shell scripts that auto kill after a certain amount of time, or at a certain time. if this is possable, what should i use in the script.

  2. #2
    Join Date
    Sep 2009
    Location
    surrey uk
    Beans
    2,057
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: shell script with an auto shutoff

    You can use
    Code:
    sleep 10
    has to be positive
    DUAL BOOT XP & Natty, Trying LFS

  3. #3
    Join Date
    Nov 2010
    Location
    India
    Beans
    Hidden!

    Re: shell script with an auto shutoff

    Quote Originally Posted by spiky001 View Post
    You can use
    Code:
    sleep 10
    has to be positive
    didn't get it . can you please elaborate it .
    Dont miss anything even it is small. one small pin is enough to bring down a man.


  4. #4
    Join Date
    Sep 2009
    Location
    surrey uk
    Beans
    2,057
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: shell script with an auto shutoff

    I dont know shell scripting sorry, but I heard of the sleep command I found an example on google, http://www.devdaily.com/blog/post/li...-sleep-command also after the sleep command you could add "kill" what ever process you want to end. Maybe post your script someone might help with it
    DUAL BOOT XP & Natty, Trying LFS

  5. #5
    Join Date
    Sep 2009
    Location
    surrey uk
    Beans
    2,057
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: shell script with an auto shutoff

    I used this one for a problem I had
    Code:
    #!/bin/bash
     sudo ifconfig eth0 down
     sleep 5
     sudo ifconfig eth0 up
     firefox &
    DUAL BOOT XP & Natty, Trying LFS

  6. #6
    Join Date
    Nov 2010
    Location
    India
    Beans
    Hidden!

    Re: shell script with an auto shutoff

    oh i think your using the script for disconnecting your eth0 connection for 10 sec and re-enabling after 10 sec . nice script . ok i have a modem with connection name as " R " . so how can i down it . i have tried as you given . but i got as this .



    Code:
    assassin@genupulas:~$ sudo ifconfig R down
    R: ERROR while getting interface flags: No such device
    thanks in advance ,
    Dont miss anything even it is small. one small pin is enough to bring down a man.


  7. #7
    Join Date
    Sep 2009
    Location
    surrey uk
    Beans
    2,057
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: shell script with an auto shutoff

    That was an example for "sleep" command
    DUAL BOOT XP & Natty, Trying LFS

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •