——————————————————————————————————————————————
This shell script can update your webserver and update your svn repository at once. More description coming soon. STILL NEEDS TO BE TESTED PROPERLY.
——————————————————————————————————————————————
case $2 in
“”)
echo “Please specify the duration”
exit;;
esac
WEBSERVER_URL=XXXXXXXXXXXXXXXXX
WEBSERVER_ADDRESS=XXXXXXXXXXXXXXXXXXxxxxx
FILES=`find $PWD -type f -cmin -$2 -print`;
LOCAL_WEB=xxxxxxxxx
AddToSVN()
{
for i in $FILES;do
if [ "$i" != '$PWD/caseShell.rb' ]; then
svn add $i
fi
done
}
UpdateToTestServer()
{
cd ..
echo “I NEED THE PASSWORD TO YOUR WEBSERVER”
scp -p -r $LOCAL_WEB $WEBSERVER_ADDRESS
echo “PLEASE PROVIDE THE PASSWORD AGAIN”
ssh $WEBSERVER_URL -l XXXXXXXXXx -i XXXXXXXXx “/etc/init.d/apache2 restart”
}
UpdateToSVN()
{
svn update
}
case $2 in
“”)
echo “Please specify the duration”
exit;;
esac
case $1 in
“t”)
AddToSVN
UpdateToTestServer
UpdateToSVN
echo “Total Update Successfully completed”;;
“s”)
AddToSVN
UpdateToSVN
echo “SVN Successfully update”;;
“ts”)
UpdateToTestServer
echo “Update test server made succesfully”;;
*)
echo “Invalid option specified”;;
esac






