From 4d07828cfcb4410057395c54e8a8163bd2b8f67f Mon Sep 17 00:00:00 2001 From: Andy Witter Date: Wed, 22 Oct 2014 07:44:34 -0400 Subject: [PATCH] Add configuration for Novelist. --- GenaSYS.sh | 106 ++++++++++++++++++++++++++++++++++++++++++------ templates/setup-head.sh | 11 +++++ 2 files changed, 105 insertions(+), 12 deletions(-) diff --git a/GenaSYS.sh b/GenaSYS.sh index 98ecb00..f08b4fd 100755 --- a/GenaSYS.sh +++ b/GenaSYS.sh @@ -25,8 +25,8 @@ PURPOSE_="Generate config files needed for Evergreen-ILS Cluster" SYNOPSIS_="$NAME_" REQUIRES_="standard GNU commands, apt, dpkg" - VERSION_="1.38" - DATE_="2010-09-23; last update: 2014-10-17" + VERSION_="1.40" + DATE_="2010-09-23; last update: 2014-10-21" AUTHOR_="Andy Witter " URL_="http://evergreen-ils.org" CATEGORY_="devel" @@ -869,7 +869,7 @@ while true; do done } -Get_Syndetics_Userid () { ### Prompt for Evergreen admin password. +Get_Syndetics_Userid () { ### Prompt for Syndetics user id. echo read -p "Enter your Syndetics user id: " SYNDETICS_USER_ID while [ "$SYNDETICS_USER_ID" = "" ] @@ -881,6 +881,56 @@ done echo } + +Get_Use_Novelist () { ### Choose Syndetics for added content. +while true; do + echo;echo;echo;echo + #echo -e $COL_BR_BLUE"____________________Added Content____________________"$COL_RESET + TitleBar "Novelist" + echo + read -n 1 -p "Do you want to use Novelist in this configuration [y/n]: " USE_NOVELIST + case $USE_NOVELIST in + [Yy]* ) echo ; break;; + [Nn]* ) echo ; break;; + * ) echo " Please answer yes or no.";; + esac +done +} + +Get_Novelist_Profile () { ### Prompt for Novelist profile. +echo +TitleBar "Novelist Profile" +read -p "Enter your Novelist profile: " NOVELIST_PROFILE +while [ "$NOVELIST_PROFILE" = "" ] + do + echo + echo -e $COL_BR_RED"Cannot be blank you must enter a Novelist profile"$COL_RESET + read -p "Enter your Novelist profile: " NOVELIST_PROFILE +done +echo +} + +Get_Novelist_Password () { ### Prompt for Novelist password. +echo +TitleBar "Novelist Password" +read -sp "Enter your password for your Novelist profile: " NOVELIST_PASSWORD +while [ "$NOVELIST_PASSWORD" = "" ] + do + echo + echo -e $COL_BR_RED"Cannot be blank you must enter a Novelist password"$COL_RESET + read -sp "Enter your Novelist password: " NOVELIST_PASSWORD +done +echo +read -sp "Confirm your password for your Novelist profile: " NOVELIST_PASSWORD_CONFIRM +while [ "$NOVELIST_PASSWORD_CONFIRM" = "" ] + do + echo + echo -e $COL_BR_RED"Cannot be blank you must enter a Novelist password"$COL_RESET + read -sp "Enter your Novelist password: " NOVELIST_PASSWORD_CONFIRM +done +echo +} + Get_Monitor_Admin_Username () { echo TitleBar "System Monitoring" @@ -1253,6 +1303,31 @@ then fi Write_Config_File SYNDETICS_USER_ID +if [ -z $USE_NOVELIST ] || [ "$USE_NOVELIST" == "0" ] +then + Get_Use_Novelist +fi +Write_Config_File USE_NOVELIST + +if [[ "$USE_NOVELIST" == "y" || "$USE_NOVELIST" == "Y" ]] +then + if [ -z "$NOVELIST_PROFILE" ] || [ "$NOVELIST_PROFILE" == "0" ] + then + Get_Novelist_Profile + fi +fi +Write_Config_File NOVELIST_PROFILE + +if [[ "$USE_NOVELIST" == "y" || "$USE_NOVELIST" == "Y" ]] +then + if [ -z "$NOVELIST_PASSWORD" ] || [ "$NOVELIST_PASSWORD" == "0" ] + then + Get_Novelist_Password + Confirm_Password '$NOVELIST_PASSWORD' '$NOVELIST_PASSWORD_CONFIRM' Get_Novelist_Password + fi +fi +Write_Config_File NOVELIST_PASSWORD + #if [ "$MONITOR_ADMIN_USERNAME" = "" ] || [ "$MONITOR_ADMIN_USERNAME" = "0" ] #then # Get_Monitor_Admin_Username @@ -2888,17 +2963,24 @@ do sed -i "s^EG_ADMIN_USER^$EG_ADMIN_USER^g" setup-head.sh sed -i "s^EG_ADMIN_PASS^$(echo $EG_ADMIN_PASSWORD | sed -e 's^&^\\\&^g' -e 's/\^/\\\^/g')^g" setup-head.sh sed -i "s^MEMCACHE01_IP^$MEMCACHE01_IP^g" setup-head.sh + if [[ "$USE_NOVELIST" == "y" || "$USE_NOVELIST" == "Y" ]] + then + echo "NOVELIST_PROFILE=${NOVELIST_PROFILE}" > ../setup_${SUBFOLDER}/.Novelist.txt + echo "NOVELIST_PASSWORD=${NOVELIST_PASSWORD}" >> ../setup_${SUBFOLDER}/.Novelist.txt + chmod 600 ../setup_${SUBFOLDER}/.Novelist.txt fi + fi + #TODO check drone pkging. - cp $TEMPLATEDIR/Net-Z3950-SimpleServer-1.12.tar.gz ../setup_${SUBFOLDER} - mv setup*.sh ../setup_${SUBFOLDER}/setup_${SUBFOLDER}.sh - mv setup-vars ../setup_${SUBFOLDER}/ - mv "setup-functions" ../setup_${SUBFOLDER}/ - tar zcf ../setup_${SUBFOLDER}/${SUBFOLDER}.tar.gz * - tar zcf ../setup_${SUBFOLDER}/${SUBFOLDER}_etc-hosts.tar.gz etc/hosts - cd .. - tar zcf setup_${SUBFOLDER}.tar.gz setup_${SUBFOLDER} - rm -rf setup_${SUBFOLDER} + cp $TEMPLATEDIR/Net-Z3950-SimpleServer-1.12.tar.gz ../setup_${SUBFOLDER} + mv setup*.sh ../setup_${SUBFOLDER}/setup_${SUBFOLDER}.sh + mv setup-vars ../setup_${SUBFOLDER}/ + mv "setup-functions" ../setup_${SUBFOLDER}/ + tar zcf ../setup_${SUBFOLDER}/${SUBFOLDER}.tar.gz * + tar zcf ../setup_${SUBFOLDER}/${SUBFOLDER}_etc-hosts.tar.gz etc/hosts + cd .. + tar zcf setup_${SUBFOLDER}.tar.gz setup_${SUBFOLDER} + rm -rf setup_${SUBFOLDER} done cd .. done diff --git a/templates/setup-head.sh b/templates/setup-head.sh index 653a6be..39eccee 100755 --- a/templates/setup-head.sh +++ b/templates/setup-head.sh @@ -300,6 +300,17 @@ then sed -i 's^# #PerlSetVar OILSRedirectTpac "true"^ PerlSetVar OILSRedirectTpac "true"^g' /etc/apache2/eg_vhost.conf fi +### Setup Novelist +if [ -e .Novelist.txt ] +then + echo;echo "Configuring Evergreen for Novelist" + sleep 2 + . .Novelist.txt + sed -i 's^#SetEnv OILS_NOVELIST_URL^SetEnv OILS_NOVELIST_URL https://imageserver.ebscohost.com/novelistselect/ns2init.js^g' /etc/apache2/eg_vhost.conf + sed -i "/SetEnv OILS_NOVELIST_URL/aSetEnv OILS_NOVELIST_PROFILE $NOVELIST_PROFILE" /etc/apache2/eg_vhost.conf + sed -i "/SetEnv OILS_NOVELIST_PROFILE/aSetEnv OILS_NOVELIST_PASSWORD $NOVELIST_PASSWORD" /etc/apache2/eg_vhost.conf +fi + ### Setup custom KPAC if [ -e kpac.xml ] then -- 2.11.0