Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I just got the following code from security-forums.com, i think: Code: #!/bin/bash while (-f "/var/run/pppkeepgoing.pid"){ /usr/bin/pppd call speedtch sleep 10 } And for some reason it doesn't work, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2003
    Location
    UK
    Posts
    9

    Script for restarting PPPd (needs fixing)


    Hi all,

    I just got the following code from security-forums.com, i think:

    Code:
    #!/bin/bash
    
    while (-f "/var/run/pppkeepgoing.pid"){
    	/usr/bin/pppd call speedtch
    	sleep 10
    }
    And for some reason it doesn't work, the errors are:

    Code:
    /sbin/keepitup: line 3: syntax error near unexpected token `{'
    /sbin/keepitup: line 3: `while (-f "/var/run/pppkeepgoing.pid"){'
    Could someone please help me out, Thanks in advance.

    Kind Regards
    Mark Rawson

  2. #2
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025
    I'd first double check your syntax from the msg/board you got it from. Letting them know it doesn't work on your sys. They may have made some cmd or syntax errors in the post.

    If no syntax errors then you can try a cmd line of "restart pppd" or "rcnetwork restart pppd" depending on your distro. See what pops up on the screen and go from there.
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

  3. #3
    Just Joined!
    Join Date
    Sep 2003
    Location
    UK
    Posts
    9
    Solved....The person who had posted the code finally replied to my query. Here is the correct code to make pppd start if not already started or quit due to errors:

    Code:
    #!/bin/bash
    
    while (test -e "/var/run/pppkeepgoing.pid"); do
    	/usr/sbin/pppd call speedtch
    	sleep 10
    done
    Thanks for your help anyway.

  4. $spacer_open
    $spacer_close

Posting Permissions

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