#!/bin/bash # echo "***" # echo "* activate.pl operating on a networked drive with a Solr-based Greenstone collection" # echo "* is known to have a problem with file locking, with an issue that seems to be" # echo "* related to it trying to reference a 'sidx' index, even though there is only a" # echo "* 'didx' for this collection." # echo "*" # echo "* As a result of this, the effective 'mv building index' command goes awry, as" # echo "* the index directory hasn't been completely removed, and so we end up with" # echo "* 'building' inside of 'index'" # echo "*" # echo "* This script implements a fix, by doing the following:" # echo "* mv index/building ." # echo "* mv index index.DUFF" # echo "* mv building index" rm -rf index.DUFF/ if [ -d index/building ] ; then echo " Moving 'building' out of 'index'" mv index/building . echo " Renaming 'index' to 'index.DUFF'" mv index index.DUFF echo " Renaming 'building' to 'index'" mv building index echo "" echo "Now restart the Greenstone3 server, as a user with sudo access:" echo " sudo systemctl restart greenstone3" else echo "Failed to find 'building' inside 'index'" >&2 echo "Directory structure not in the form expected for fixing" >&2 echo "Exiting" >&2 fi