Current time: 11-26-2024, 06:43 PM Hello There, Guest! (LoginRegister)


Post Reply 
How to setup a server to follow development?
Author Message
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #15
RE: How to setup a server to follow development?
Tested and it`s ok. But i`m even lazzyer then you Tongue
Quote:#!/bin/sh
#
# ispcp-nightly-update
# Version: 0.0.1
# License: GPL
# Author : ispcomm
# Credits: ispcp development team
# Variables
BACKUPDIR="/var/www/backup"
WWWDIR="/var/www"
ISPCPDIR="${WWWDIR}/ispcp/"
REBUILD_SITES="yes"
TRUNK_DIR="/tmp/svn/"

#download trunk
mkdir -p ${TRUNK_DIR}
svn checkout http://www.isp-control.net/ispcp_svn/trunk/ ${TRUNK_DIR}
cd ${TRUNK_DIR}


# Backup current installation
mkdir -p ${BACKUPDIR}
pushd ${BACKUPDIR}

tar czpf "ispcp_backup-`date +'%Y-%m-%d %H-%M-%S'`.tar.gz" ${WWWDIR}/ispcp/
tar czpf "ispcp_backup-etc-`date +'%Y-%m-%d %H-%M-%S'`.tar.gz" /etc/ispcp/
cp -v ${WWWDIR}/ispcp/engine/ispcp-db-keys.pl .
cp -v ${WWWDIR}/ispcp/gui/include/ispcp-db-keys.php .
cp -v ${WWWDIR}/ispcp/gui/tools/pma/config.inc.php .
popd

# Compile ispcp. Install will copy files to /tmp/ispcp
make clean install

# Update current installation
/etc/init.d/ispcp_daemon stop
pushd /tmp/ispcp${WWWDIR}
cp -vR ispcp/ ${WWWDIR}
find ${ISPCPDIR} -type d -name '.svn' -exec rm -fr '{}' \;
popd

pushd ${BACKUPDIR}
cp -v ispcp-db-keys.pl ${WWWDIR}/ispcp/engine/
cp -v ispcp-db-keys.pl ${WWWDIR}/ispcp/engine/messager/
cp -v ispcp-db-keys.php ${WWWDIR}/ispcp/gui/include/
cp -v config.inc.php ${WWWDIR}/ispcp/gui/tools/pma/
popd

pushd ${WWWDIR}/ispcp/engine/setup/
./set-engine-permissions.sh
./set-gui-permissions.sh
popd

#../parts copying. This must be tuned by someone who know bash better then me. Work only with debian
find /tmp/ispcp/etc/ispcp -type d -name '.svn' -exec rm -fr '{}' \;

bla=`find /tmp/ispcp/etc/ispcp -type d -name 'parts' | awk -F"/" '{print "/"$2"/"$3"/"$4"/"$5"/"$6"/"$7}'`;
for x in $bla
do
bla2=`echo ${x} | awk -F"/" '{print "/"$4"/"$5"/"$6}'`
cp -vR $x $bla2
done

if [ $REBUILD_SITES == "yes" ] ; then
# Some old releases require this. not necessary for current ones.
#DELETE FROM config WHERE name = 'DATABASE_REVISION';
#read -p "Enter mysql pasword on prompt"
cat <<EOF | mysql -uroot -pYOURPASSWORD ispcp
UPDATE mail_users SET status='toadd' where status='ok';
UPDATE domain SET domain_status = 'change' WHERE domain_status = 'ok';
UPDATE domain_aliasses SET alias_status = 'change' WHERE alias_status = 'ok';
UPDATE subdomain SET subdomain_status = 'change' WHERE subdomain_status = 'ok';
EOF

${ISPCPDIR}/engine/ispcp-rqst-mngr
fi
/etc/init.d/ispcp_daemon start
rm -fRv /tmp/ispcp
/etc/init.d/apache2 restart
/etc/init.d/bind9 restart
Worked for me and i have added ../parts/ copy. Now i can update with cron.
(This post was last modified: 05-16-2008 03:14 AM by sci2tech.)
05-12-2008 07:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to setup a server to follow development? - sci2tech - 05-12-2008 07:21 AM

Forum Jump:


User(s) browsing this thread: 10 Guest(s)