system_upgrade.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. # Licensed Materials - Property of IBM
  3. #
  4. # IBM Cognos Products: ps
  5. #
  6. # (C) Copyright IBM Corp. 2005, 2010
  7. #
  8. # US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. #
  10. # Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  11. # Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  12. #
  13. # -----------------------------------------------------------------------------
  14. # system_upgrade.sh - upgrade system.xml on UNIX
  15. #
  16. # JAVA_HOME Must point at your Java Development Kit installation.
  17. # -----------------------------------------------------------------------------
  18. echo "Only execute this script, if the automatic system.xml upgrade failed."
  19. echo "Please follow the instructions in the system_upgrade.txt file before proceeding."
  20. echo "Do you wish to proceed (y/n)?"
  21. read a
  22. if [ $a = y ];
  23. then
  24. # environment
  25. HERE=`pwd`
  26. P2PD_WEBINF=$HERE/../../webapps/p2pd/WEB-INF/lib
  27. if [ ! -d "${P2PD_WEBINF}" ];
  28. then
  29. P2PD_WEBINF=$HERE/../../bin
  30. fi
  31. if [ ! -d "${P2PD_WEBINF}" ];
  32. then
  33. echo "Unable to locate the P2PD web-inf directory $P2PD_WEBINF or the bin directory"
  34. exit 1
  35. else
  36. CP=$JAVA_HOME/lib/tools.jar
  37. CP=$CP:$P2PD_WEBINF/xercesImpl.jar
  38. CP=$CP:$P2PD_WEBINF/jdxslt.jar
  39. cp system.xml systemv1.xml
  40. $JAVA_HOME/bin/java -classpath $CP \
  41. jd.xml.xslt.Stylesheet -out system.xml systemv1.xml system_upgrade.xslt
  42. cd portal
  43. cp system.xml systemv1.xml
  44. $JAVA_HOME/bin/java -classpath $CP \
  45. jd.xml.xslt.Stylesheet -out system.xml systemv1.xml system_upgrade.xslt
  46. cd ../qs
  47. cp system.xml systemv1.xml
  48. $JAVA_HOME/bin/java -classpath $CP \
  49. jd.xml.xslt.Stylesheet -out system.xml systemv1.xml system_upgrade.xslt
  50. echo "success"
  51. exit 0
  52. fi
  53. else
  54. echo "Upgrade skipped"
  55. exit 0
  56. fi