After switching from scripting PHP to compiled ECPP I was fooled several
times by the need re-compile an application and restart tntnet.  So I
wrote a script that runs make and restarts the server.  Hope it will be
useful for those who develops with ECPP.

How to use:

1) Put the script into a directory that is in the PATH list, e.g.,
~/bin.
2) Go to your project directory.
3) Run the script.

The script will  run make first.  If make fails, the script will offer
to re-run make (default) or to quit.
If make succeeds, the script will offer to start tntnet (default) or to
quit.
If you choose to start tntnet, you can then stop it by pressing Ctl+C.
After tntnet is stopped, the script will run make again, and so on.

Yuri

------------------------------------------------------------------------------------
#! /bin/bash

while true; do
  while true; do
    if make; then
      echo "SUCCESS! "
      echo -n "'Q' to quit, any key to start tntnet [S/q] "
      read resp
      case $resp in
        [qQ])
           break 2
        ;;
        *)
           break 1
        ;;
      esac
    else
      echo "ERROR ... "
      echo -n "'Q' to quit, 'C' to continue, any key to re-compile [R/q]
"
      read resp
      case $resp in
        [qQ])
           break 2
        ;;
        [cC])
           break 1
        ;;
        *)
        ;;
      esac
    fi
  done
  trap "echo tntnet interrupted" SIGINT
  tntnet -c tntnet.conf
  trap SIGINT
done
------------------------------------------------------------------------------------

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to