Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    block and unblock shell script


    I want to write a shell script which start tcpdump and firefox, and then it get blocked there until a signal comes

    like

    Code:
    for ()
    do
    tcpdump &
    firefox &
    
    blocked here
    
    wait for signal or anything else
    
    unblock
    
    kill firefox and tcp process
    
    do some other things
    
    done
    besides, actually the shell script is wating for a php script finishes some work, is there any good idea for the php script to signal the shell script ?

  2. #2
    hi,

    use fifo

    your shell script reads the fifo (which "blocks" the shell script)
    your php script, before ending, writes into the fifo (which "frees" the shell script, that, then, executes next commands(kill tcpdump and firefox))

  3. #3
    Quote Originally Posted by esolve View Post
    I want to write a shell script which start tcpdump and firefox, and then it get blocked there until a signal comes
    What do you mean by blocked exactly?

    besides, actually the shell script is wating for a php script finishes some work, is there any good idea for the php script to signal the shell script ?
    Did you not try the suggestion I made in your previous thread here? Using the Bash trap function and the kill command to send signals will easily do this.

  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
  •