#!/bin/csh -f # hhlgetwiki # ------------------------------------------------------------------------- # Shell script to update a local copy of the HHL Wiki. # ------------------------------------------------------------------------- # Revision History: # $Log$ # ------------------------------------------------------------------------- if ($1:q == "-h" || $1:q == "--help") then echo "Usage: $0:t" exit 1 endif # How to export HHL Wiki automatically instead of having user do it? open https://helphopelive.atlassian.net/wiki/spaces/exportspacehtml.action\?key=HHLWEB set prompt = "Done with Custom Export | Include comments | Desktop (y/n)? " set exportdone = `promptloop "${prompt}" y n` if ($exportdone != "y") then exit 1 endif set tempdir = ~/desktop set tempcopy = "${tempdir}/HHLWEB" set realcopy = "~/fred/HHL/Wiki/HHLWEB" cd $tempdir unzip Confluence-space-export-*.html*.zip rm -iv Confluence-space-export-*.html*.zip echo "windiff $tempcopy $realcopy" windiff $tempcopy $realcopy set prompt = "Accept all changes to the Wiki (y/n)? " set accept = `promptloop "${prompt}" y n` if ($accept == "y") then chmod -R 755 $realcopy rsyncupdate --log --del $tempcopy/ $realcopy endif set prompt = "Delete $tempcopy (y/n)? " set accept = `promptloop "${prompt}" y n` if ($accept != "y") then exit 1 endif rm -v -R $tempcopy