setup.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. #
  3. # This script can be used to generate the required, machine-specific
  4. # configuration file: GeminiHello-[MACHINE_NAME].conf
  5. #
  6. # The intent is that developers would run this script once as part
  7. # of their initial setup. On Windows, the script can be run through
  8. # Git bash.
  9. projectName="GeminiHello"
  10. machineNameUpper="`echo $HOSTNAME|tr '[a-z]' '[A-Z]'`"
  11. machineNameLower="`echo $HOSTNAME|tr '[A-Z]' '[a-z]'`"
  12. directoryName=$(cd `dirname $0` && pwd)
  13. user=`echo \`id -nu\``
  14. # If the file we wanted to generate already exists, don't bother
  15. # creating a new one.
  16. configurationFile=$directoryName/Docroot/WEB-INF/$projectName-$machineNameUpper.conf;
  17. if [ -f $configurationFile ]
  18. then
  19. echo "The configuration file $configurationFile already exists. Exiting."
  20. exit 0
  21. else
  22. echo "Creating configuration file: $configurationFile"
  23. fi
  24. # Write the required configuration attributes to the file.
  25. echo "# -----------------------------------------------------------------------" > $configurationFile
  26. echo "# GEMINIHELLO configuration file " >> $configurationFile
  27. echo "# " >> $configurationFile
  28. echo "# MACHINE-SPECIFIC CONFIGURATION " >> $configurationFile
  29. echo "# " >> $configurationFile
  30. echo "# The configuration attributes specified in this file are specific to a " >> $configurationFile
  31. echo "# single development-environment machine. " >> $configurationFile
  32. echo "# -----------------------------------------------------------------------" >> $configurationFile
  33. echo "" >> $configurationFile
  34. echo "# Extend the development configuration, which in turn extends the " >> $configurationFile
  35. echo "# baseline configuration." >> $configurationFile
  36. echo "Extends = $projectName-Dev.conf" >> $configurationFile
  37. echo "" >> $configurationFile
  38. echo "# Now set any attributes that are specific to this machine." >> $configurationFile
  39. echo "StandardDomain = http://$machineNameLower.techempower.com" >> $configurationFile
  40. echo "SecureDomain = https://$machineNameLower.techempower.com" >> $configurationFile
  41. echo "#OutboundMailEnabled = yes" >> $configurationFile
  42. echo "StartupMailAuthor = [email protected]" >> $configurationFile
  43. echo "FromEmailAddress = [email protected]" >> $configurationFile
  44. echo "PasswordReset.FromAddress = [email protected]" >> $configurationFile
  45. echo "EmailExceptionHandler.ToEmailAddress = [email protected]" >> $configurationFile
  46. echo "EmailExceptionHandler.FromEmailAddress = [email protected]" >> $configurationFile
  47. exit 0