INSTALL-mon 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/sh
  2. # $Id: INSTALL-mon,v 1.2 2003/02/20 20:59:53 dijkstra Exp $
  3. #
  4. # Pre/post-installation setup of symon monitor
  5. # exit on errors, use a sane path and install prefix
  6. #
  7. set -e
  8. PATH=/bin:/usr/bin:/sbin:/usr/sbin
  9. PREFIX=${PKG_PREFIX:-/usr/local}
  10. CONFIG_FILE=${SYSCONFDIR}/symon.conf
  11. SAMPLE_CONFIG_FILE=$PREFIX/share/examples/symon/symon.conf
  12. do_notice()
  13. {
  14. echo
  15. echo "+---------------"
  16. echo "| The existing $1 configuration file, $CONFIG_FILE,"
  17. echo "| has NOT been changed. You may want to compare it to the"
  18. echo "| current sample file, $SAMPLE_CONFIG_FILE,"
  19. echo "| and update your configuration as needed."
  20. echo "+---------------"
  21. echo
  22. }
  23. do_install()
  24. {
  25. $PREFIX/share/symon/c_config.sh 127.0.0.1 2100 > $CONFIG_FILE
  26. echo
  27. echo "+---------------"
  28. echo "| The $1 configuration file, $CONFIG_FILE, has been generated by"
  29. echo "| $PREFIX/share/symon/c_config.sh. It has been filled with cpu, memory,"
  30. echo "| pf, default disks and interfaces. Please review this file and change"
  31. echo "| the configuration to suit your needs."
  32. echo "+---------------"
  33. echo
  34. }
  35. # verify proper execution
  36. #
  37. if [ $# -ne 2 ]; then
  38. echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
  39. exit 1
  40. fi
  41. # Verify/process the command
  42. #
  43. case $2 in
  44. PRE-INSTALL)
  45. : nothing to pre-install for this port
  46. ;;
  47. POST-INSTALL)
  48. if [ -f $CONFIG_FILE ]; then
  49. do_notice $1
  50. else
  51. do_install $1
  52. fi
  53. ;;
  54. *)
  55. echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
  56. exit 1
  57. ;;
  58. esac
  59. exit 0