Guest User

Untitled

a guest
Apr 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 KB | None | 0 0
  1. # set variables
  2. proc_id=$0
  3. proc_state=$1
  4.  
  5. if [ $(pidof -s flite) ]; then
  6.  
  7.  
  8. echo $proc_state > /dev/tty
  9. proc_id=$(pidof -s flite)
  10.  
  11.         if [ "$proc_state" == "reading" ]; then
  12.         kill $proc_id -stop
  13.         proc_state="pause"
  14.         echo $proc_state > /dev/tty
  15.         fi
  16.      
  17.        if [ "$proc_state" == "pause" ]; then
  18.        kill $proc_id -cont
  19.        proc_state="ready"
  20.        fi
  21.  
  22.  
  23.  
  24. else    
  25.  
  26. proc_state="reading"
  27. xsel | flite -voice slt
  28. echo "shit" > /dev/tty
  29. echo "your in deep shit $proc_id and the proc state is $proc_state" #if process does not exist
  30. fi
Add Comment
Please, Sign In to add comment