fork download
  1. #!/bin/bash
  2. # your code goes here
  3.  
  4. AUTOSTART="default another"
  5.  
  6. SOCAT_default="TCP4-LISTEN:3724,nodelay,fork,reuseaddr,su=nobody TCP4:your.wow.server.ip.address:3724,nodelay"
  7. SOCAT_another="test,args"
  8.  
  9. start () {
  10. echo "Starting $DESC:"
  11. umask 027
  12. cd /tmp
  13. if test "x$AUTOSTART" = "xnone" -o -z "x$AUTOSTART" ; then
  14. echo "Autostart disabled."
  15. exit 0
  16. fi
  17. for NAME in $AUTOSTART ; do
  18. ARGS=`eval echo \\\$SOCAT_$NAME`
  19. echo $ARGS
  20. echo " $NAME $ARGS"
  21. done
  22. return $?
  23. }
  24.  
  25. start
Success #stdin #stdout 0.02s 5312KB
stdin
Standard input is empty
stdout
Starting :
TCP4-LISTEN:3724,nodelay,fork,reuseaddr,su=nobody TCP4:your.wow.server.ip.address:3724,nodelay
 default TCP4-LISTEN:3724,nodelay,fork,reuseaddr,su=nobody TCP4:your.wow.server.ip.address:3724,nodelay
test,args
 another test,args