summaryrefslogtreecommitdiff
path: root/bin/reevotech/PullPages.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/reevotech/PullPages.sh')
-rwxr-xr-xbin/reevotech/PullPages.sh43
1 files changed, 33 insertions, 10 deletions
diff --git a/bin/reevotech/PullPages.sh b/bin/reevotech/PullPages.sh
index e479e39e..29071c24 100755
--- a/bin/reevotech/PullPages.sh
+++ b/bin/reevotech/PullPages.sh
@@ -10,25 +10,48 @@ fi
cd /srv/reevotech
DEPLOY=$1
-DEPLOYFILE=`ls ./etc | grep $DEPLOY`
-NS=$2
+DEPLOYFILE=`ls ./etc | grep $DEPLOY | grep -v '.test' | grep -v '.old'`
DOMAIN=`cat ./etc/$DEPLOYFILE | grep 'REEVO_URL =' | cut -d'"' -f 2`
+
# echo $DEPLOY
# echo $DEPLOYFILE
# echo $DOMAIN
cd ./www/wiki/deployments/$DEPLOY
-if [[ -d pages_tmp/$NS ]]
+update_ns () {
+ if [[ -d pages_tmp/$1 ]]
+ then
+ echo ""
+ cd pages_tmp/$1
+ git pull
+ cd ../../
+ else
+ git clone -c remote.origin.namespaces="$1" mediawiki::http://$DOMAIN pages_tmp/$1
+ fi
+
+ cp -rf pages_tmp/$1 pages
+ rm -rf pages/$1/.git
+}
+
+NS=$2
+
+if [ -z "$2" ]
then
+ echo "This script download the wikipages in the DB to text files..."
+ echo "I am going to process all the active NameSpaces for the specified deployment:"
+ ls pages
echo ""
- cd pages_tmp/$NS
- git pull
- cd ../../
+ echo "Enter to continue..."
+ read
+ for i in `ls pages`
+ do
+ update_ns $i
+ done
+
else
- git clone -c remote.origin.namespaces="$NS" mediawiki::http://$DOMAIN pages_tmp/$NS
+ echo "This script download the wikipages in the DB to text files..."
+ echo "I am going to process only the specificed NameSpace: $NS"
+ update_ns $NS
fi
-
-cp -rf pages_tmp/$NS pages
-rm -rf pages/$NS/.git