summaryrefslogtreecommitdiff
path: root/bin/reevotech/PutPages.sh
blob: abf6065eaa87357df285654f9690dab77728b830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Use: ./bin/reevotech/PutPages.sh ecoversities Property

if [ $# -eq 0 ]
  then
    echo "Missing parameters. Use: ./bin/reevotech/PutPages.sh ecoversities Help"
    exit
fi

DEPLOY=$1
cd /srv/reevotech/www/wiki/maintenance/

update_ns () {
  echo ""
  echo "########### Updating pages in $1"
  php importTextFiles.php --conf ../LocalSettings-$DEPLOY.php -s "Updated using PutPages.sh"  --overwrite  "../deployments/$DEPLOY/pages/$1/*"
  echo ""
}

NS=$2
if [ -z "$2" ]
then
  echo "This script replaces the wikipages from the text files to the DB..."
  echo "I am going to update pages in all the active NameSpaces for the specified deployment:"
  ls ../deployments/$DEPLOY/pages/
  echo ""
  # echo "Enter to continue..."
  read
  for i in `ls ../deployments/$DEPLOY/pages/`
  do
    update_ns $i
  done

else
  echo "This script replaces the wikipages from the text files to the DB..."
  echo "I am going to process only the specificed NameSpace: $NS"
  update_ns $NS
fi

/usr/bin/php runJobs.php  --conf /srv/reevotech/www/wiki/LocalSettings-$DEPLOY.php