# ### adminsync.sh ### ### Generate hyperlinked reference to ### //depot/admin documents in Peforce Repository ### ### ### This script should be run on the Huxley box ### ### Client: www.setgetweb.com.admin ### Host: www.setgetweb.com ### Root: /usr/tomcat/webapps/ROOT/depot/admin ### View: ### //depot/admin/... //www.setgetweb.com.admin/... ### ### Lights for navigating the labyrinth. ### date PATH=/usr/java/jdk1.3.1_03/bin:/usr/tomcat/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/map/bin:/usr/local/bin:/usr/local/ant/bin:/usr/bin:/bin export PATH olddir=`pwd` ### ### In this version, //depot/admin depot code needs to sit under a document root. ### ### admin=/usr/tomcat/webapps/ROOT/depot/admin ### ### Sync with Perforce depot to get newest code ### rm -rf $admin/* P4ROOT=/usr/p4 P4CLIENT=www.setgetweb.com.admin export P4CLIENT export P4PASSWD p4 sync -f > /tmp/adminlist.tmp grep -E 'updating|added|refreshing' /tmp/adminlist.tmp | \ grep -v \.war | \ grep -v \.jar | \ cut -d"#" -f1 | \ sed "s://depot/admin/:/usr/tomcat/webapps/ROOT/depot/admin/:" | \ sed "s/$/.html/" | \ grep -v " " > /tmp/adminlist.out ### ### Recurse through subdirectories and ### Create HTML versions of all text files ### echo " " echo "Creating HTML files" for i in `cat /tmp/adminlist.out | grep -v *.jar | grep -v .war | grep -v \.doc` do z=`dirname $i` f=`basename $i .html` echo $z $f cd $z convertb.sh $f done ### ### Derive index.html file ### /usr/local/bin/adminidx.sh ### ### Recurse through subdirectories ### For every *.html file found, ### send request to generate links ### echo " " echo "Generating links..." for i in `ls -lR $admin | grep -v " " | grep \/ | sed "s/://g"` do cd $i for z in `ls *.html 2>/dev/null | \ grep -v \.html.html | \ grep -v index.html` do x=`basename $z .html` /usr/local/bin/adminlink.sh $z $x done done ### ### Go home. ### Check to see how long we were gone. ### cd $olddir date