To the Brass 
Cannon Webboard
Established 1986

Kevin Martin - PO Box 82783 - Portland, OR 97282
Back to Content-Site Update

This page won't make a lot of sense unless you've come from the page linked above.

Note these two copies of the script have a lot of assumptions built in; in particular, when the .zip file is created, it must be made with the "include directory path" option, starting in the "Unpack" directory.

If you're looking for a general "zip and unzip" shell script, you're welcome to study this one. It won't do anything useful for you unless you make extensive changes, though.


The mvcont Unix shell script - QA version

From sabre:/kmartin/bin

#!/bin/sh
cd /tmp
if ![ -f $1.zip ]
then
 echo Usage $0 {contxxx} - $1.zip not found
 exit 2
fi
if [ -d Unpack ]
then
 rm -rf Unpack
fi
unzip $1.zip
cd Unpack
chown -R nobody:web .
find . -type d | xargs -i chmod 775 {}
find . -type f | xargs -i chmod 664 {}
tar cf $1.tar ./htdocs ./php ./php_common ./php_oursite
rm -rf /httpd/htdocs
rm -rf /httpd/php
rm -rf /httpd/php_common
rm -rf /httpd/php_oursite
mv htdocs /httpd
mv php /httpd
mv php_common /httpd
mv php_oursite /httpd
echo Done


The mvcont Unix shell script - staging version

From production-4:/root/bin

#!/bin/sh
cd /tmp
if ![ -f $1.zip ]
then
 echo Usage $0 {contxxx} - $1.zip not found
 exit 2
fi
if [ -d Unpack ]
then
 rm -rf Unpack
fi
unzip $1.zip
cd Unpack
chown -R http:www .
find . -type d | xargs -i chmod 775 {}
find . -type f | xargs -i chmod 664 {}
tar cf $1.tar ./htdocs ./php*
mv $1.tar /tmp
rm -rf /app/htdocs
rm -rf /app/php*
mv htdocs /app
mv php /app
mv php_common /app
mv php_oursite /app
echo Done

Back to Content-Site Update

Please Note

If a search engine dropped you directly into this document, you should go to the index page to find out what you're reading. This document is a record of a project from 1999-2000 -- the collection as a whole is not intended to be used as a current guide to installing any software product.