Index: trunk/tools/mwmultiversion/scripts/mwscriptwikiset |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +#!/bin/bash |
| 3 | +# Shell wrapper for the local version of multiversion/MWScript.php. |
| 4 | +# This script belongs in /usr/bin/ and should be in PATH. |
| 5 | +# Unlike mwscript, the takes a dblist filename as the second argument |
| 6 | +# and runs the maintenance script on each of the wikis in the list. |
| 7 | +# Note that this script prints some status info. |
| 8 | +COMMONDIR=/usr/local/apache/common-local |
| 9 | + |
| 10 | +SCRIPTFILE=$1 |
| 11 | +LISTFILE=$2 |
| 12 | + |
| 13 | +# Check that dblist is given and actually exists... |
| 14 | +if [ $# -lt 2 ]; then |
| 15 | + echo 'Usage: mwscriptwikiset <script path> <filename.dblist> [script args]' |
| 16 | + echo 'Note: No --wiki option or equivalent argument should be given' |
| 17 | + exit 1 |
| 18 | +fi |
| 19 | + |
| 20 | +if [ ! -f $COMMONDIR/$LISTFILE ]; then |
| 21 | + echo "The specified dblist file, $COMMONDIR/$LISTFILE, could not be found." |
| 22 | + exit 1 |
| 23 | +fi |
| 24 | + |
| 25 | +# Get the arguments to the actual script file |
| 26 | +SCRIPTARGS=("$@") |
| 27 | +unset SCRIPTARGS[0] # script path |
| 28 | +unset SCRIPTARGS[1] # dblist file name |
| 29 | +SCRIPTARGS="${SCRIPTARGS[@]}" |
| 30 | + |
| 31 | +# Run the script on all wikis in the dblist |
| 32 | +for DBNAME in $(cat $COMMONDIR/$LISTFILE) |
| 33 | +do |
| 34 | + echo "-------------------------------------" |
| 35 | + echo "$DBNAME" |
| 36 | + echo "-------------------------------------" |
| 37 | + php /usr/local/apache/common-local/multiversion/MWScript.php "$SCRIPTFILE" "$DBNAME" "$SCRIPTARGS" |
| 38 | + echo "-------------------------------------" |
| 39 | + echo "" |
| 40 | +done |
| 41 | + |
Property changes on: trunk/tools/mwmultiversion/scripts/mwscriptwikiset |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 42 | + native |
Added: svn:executable |
2 | 43 | + * |