setup.sh 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
  10. export RESIN_HOME=${IROOT}/resin-4.0.41
  11. projectName="GeminiHello"
  12. machineNameUpper="`echo $HOSTNAME|tr '[a-z]' '[A-Z]'`"
  13. machineNameLower="`echo $HOSTNAME|tr '[A-Z]' '[a-z]'`"
  14. directoryName=$(cd `dirname $0` && pwd)
  15. user=`echo \`id -nu\``
  16. # If the file we wanted to generate already exists, don't bother
  17. # creating a new one.
  18. configurationFile=$directoryName/Docroot/WEB-INF/$projectName-$machineNameUpper.conf;
  19. if [ -f $configurationFile ]
  20. then
  21. echo "The configuration file $configurationFile already exists. Exiting."
  22. exit 0
  23. else
  24. echo "Creating configuration file: $configurationFile"
  25. fi
  26. # Write the required configuration attributes to the file.
  27. echo "# -----------------------------------------------------------------------" > $configurationFile
  28. echo "# GEMINIHELLO configuration file " >> $configurationFile
  29. echo "# " >> $configurationFile
  30. echo "# MACHINE-SPECIFIC CONFIGURATION " >> $configurationFile
  31. echo "# " >> $configurationFile
  32. echo "# The configuration attributes specified in this file are specific to a " >> $configurationFile
  33. echo "# single development-environment machine. " >> $configurationFile
  34. echo "# -----------------------------------------------------------------------" >> $configurationFile
  35. echo "" >> $configurationFile
  36. echo "# Extend the development configuration, which in turn extends the " >> $configurationFile
  37. echo "# baseline configuration." >> $configurationFile
  38. echo "Extends = $projectName-Dev.conf" >> $configurationFile
  39. echo "" >> $configurationFile
  40. echo "# Now set any attributes that are specific to this machine." >> $configurationFile
  41. echo "StandardDomain = http://$machineNameLower.techempower.com" >> $configurationFile
  42. echo "SecureDomain = https://$machineNameLower.techempower.com" >> $configurationFile
  43. echo "#OutboundMailEnabled = yes" >> $configurationFile
  44. echo "StartupMailAuthor = [email protected]" >> $configurationFile
  45. echo "FromEmailAddress = [email protected]" >> $configurationFile
  46. echo "PasswordReset.FromAddress = [email protected]" >> $configurationFile
  47. echo "EmailExceptionHandler.ToEmailAddress = [email protected]" >> $configurationFile
  48. echo "EmailExceptionHandler.FromEmailAddress = [email protected]" >> $configurationFile
  49. exit 0