summaryrefslogtreecommitdiff
path: root/bin/reevotech/PullPages.sh
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2023-04-26 15:38:12 -0300
committerYaco <franco@reevo.org>2023-04-26 15:38:12 -0300
commit4a272f1f23f08c91beb126a86d1c80cf59ddfc37 (patch)
tree0cceca007963f0aa8c00419fe1ec78507f428073 /bin/reevotech/PullPages.sh
parent41a0cd881fabc071458a49b2c86f370aad5ca5a1 (diff)
updates scripts
Diffstat (limited to 'bin/reevotech/PullPages.sh')
-rwxr-xr-xbin/reevotech/PullPages.sh43
1 files changed, 32 insertions, 11 deletions
diff --git a/bin/reevotech/PullPages.sh b/bin/reevotech/PullPages.sh
index 475b5485..29071c24 100755
--- a/bin/reevotech/PullPages.sh
+++ b/bin/reevotech/PullPages.sh
@@ -11,26 +11,47 @@ cd /srv/reevotech
DEPLOY=$1
DEPLOYFILE=`ls ./etc | grep $DEPLOY | grep -v '.test' | grep -v '.old'`
-echo $DEPLOYFILE
-read
-NS=$2
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