Changeset 3681

Show
Ignore:
Timestamp:
05/14/08 05:19:19 (3 months ago)
Author:
coderanger
Message:

Latest version of the bashrc script.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tracbashrcscript/0.11/bashrc.txt

    r3029 r3681  
    4242# Edit trac.ini 
    4343function tini { 
     44    ( 
     45    if [ "$1" ] 
     46    then 
     47        tset $1 
     48    fi 
     49     
    4450    $EDITOR $TRAC/conf/trac.ini 
     51     
     52    ) 
    4553} 
    4654 
     
    212220} 
    213221complete -F _tset tset 
     222complete -F _tset tini 
    214223 
    215224# Control the nginx and tracd servers 
     
    236245            echo "<html><head><title>Trac Development System</title></head><body>" >$TRAC_BASE/.www/index.html 
    237246            echo -e "location /src {\n  alias $TRAC_BASE/plugins;\n  autoindex on;\n}" >$TRAC_BASE/.www/conf 
     247            echo -e "location /pypi {\n  fastcgi_pass 127.0.0.1:1025;\n}" >>$TRAC_BASE/.www/conf 
    238248            for version in $INSTALL_BASE/* 
    239249            do 
    240                 ( 
    241                 tversion "$(basename $version)" 
    242                 echo "Starting tracd for version $TRAC_VERSION on port $port" 
    243                 tracd -p $port -r -e $version/tracs --base-path="$TRAC_VERSION" >$version/.tracd.log 2>&1 & 
    244                 echo "<h3><a href=\"/$(basename $version)\">Trac $(basename $version)</a></h3><ul>" >>$TRAC_BASE/.www/index.html 
    245                 for t in $version/tracs/* 
    246                 do 
    247                     echo "<li><a href=\"/$(basename $version)/$(basename $t)\">$(basename $t)</li>" >>$TRAC_BASE/.www/index.html 
    248                 done 
    249                 echo "</ul>" >>$TRAC_BASE/.www/index.html 
     250                if [ ! -f "$version/.disable" ] 
     251                then 
     252                  ( 
     253                  tversion "$(basename $version)" 
     254                  echo "Starting tracd for version $TRAC_VERSION on port $port" 
     255                  tracd -p $port -r -e $version/tracs --base-path="$TRAC_VERSION" >$version/.tracd.log 2>&1 & 
     256                  echo "<h3><a href=\"/$(basename $version)\">Trac $(basename $version)</a></h3><ul>" >>$TRAC_BASE/.www/index.html 
     257                  for t in $version/tracs/* 
     258                  do 
     259                      if [ -d "$t" ] 
     260                      then 
     261                        echo "<li><a href=\"/$(basename $version)/$(basename $t)\">$(basename $t)</li>" >>$TRAC_BASE/.www/index.html 
     262                      fi 
     263                  done 
     264                  echo "</ul>" >>$TRAC_BASE/.www/index.html 
    250265                 
    251                 # Output proxy directives 
    252                 echo "location /$TRAC_VERSION {" >>$TRAC_BASE/.www/conf 
    253                 echo "  proxy_pass http://127.0.0.1:$port;" >>$TRAC_BASE/.www/conf 
    254                 echo "  include $NGINX_BASE/conf/proxy.conf;" >>$TRAC_BASE/.www/conf 
    255                 echo "}" >>$TRAC_BASE/.www/conf 
    256                 ) 
    257                  
    258                 port=$(($port + 1)) 
     266                  # Output proxy directives 
     267                  echo "location /$TRAC_VERSION {" >>$TRAC_BASE/.www/conf 
     268                  echo "  proxy_pass http://127.0.0.1:$port;" >>$TRAC_BASE/.www/conf 
     269                  echo "  include $NGINX_BASE/conf/proxy.conf;" >>$TRAC_BASE/.www/conf 
     270                  echo "}" >>$TRAC_BASE/.www/conf 
     271                  ) 
     272                   
     273                  port=$(($port + 1)) 
     274                else 
     275                  ( 
     276                  tversion "$(basename $version)" 
     277                  echo "Skipping version $TRAC_VERSION" 
     278                  ) 
     279                fi 
    259280            done 
    260281            echo "</body></html>" >>$TRAC_BASE/.www/index.html 
     
    310331            then 
    311332                echo "Server is running" 
     333                 
     334                # Check for running tracd 
     335                for version in $INSTALL_BASE/* 
     336                do 
     337                    pids="$(ps -axwwo pid,command | grep $version/bin/tracd | grep -v grep | awk '{print $1}')" 
     338                    if [ "$pids" ]  
     339                    then 
     340                        echo -n "tracd running for $(basename $version) (" 
     341                        echo -n "$pids" | sort -n | tr '\n' ' ' 
     342                        echo ")" 
     343                    fi 
     344                done 
    312345                return 0 
    313346            else