install-ipfcst-v3.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/sh
  2. export basedir=/home/syjy/ipfcstV3
  3. chmod 777 $basedir/*
  4. chmod -R 777 $basedir/bin
  5. chmod -R 777 $basedir/settings
  6. chmod -R 777 $basedir/jdk
  7. chmod -R 777 $basedir/produce
  8. cd $basedir/jdk
  9. echo "Install jdk8!"
  10. tar -zxvf jdk-8u261-linux-x64.tar.gz
  11. if test -e /home/syjy/patch.zip; then
  12. cd /home/syjy
  13. unzip -o patch.zip
  14. fi
  15. if test -x /usr/lib/systemd/system; then
  16. cp -f $basedir/settings/monitor.service /usr/lib/systemd/system
  17. cp -f $basedir/settings/console.service /usr/lib/systemd/system
  18. cp -f $basedir/settings/reportquery.service /usr/lib/systemd/system
  19. chmod 777 /usr/lib/systemd/system/monitor.service
  20. chmod 777 /usr/lib/systemd/system/console.service
  21. chmod 777 /usr/lib/systemd/system/reportquery.service
  22. fi
  23. if test -x /lib/systemd/system; then
  24. cp -f $basedir/settings/monitor.service /lib/systemd/system
  25. cp -f $basedir/settings/console.service /lib/systemd/system
  26. cp -f $basedir/settings/reportquery.service /lib/systemd/system
  27. chmod 777 /lib/systemd/system/monitor.service
  28. chmod 777 /lib/systemd/system/console.service
  29. chmod 777 /lib/systemd/system/reportquery.service
  30. fi
  31. if test -x /etc/init.d; then
  32. cp -f $basedir/settings/monitor /etc/init.d/
  33. cp -f $basedir/settings/console /etc/init.d/
  34. cp -f $basedir/settings/reportquery /etc/init.d/
  35. chmod 777 /etc/init.d/monitor
  36. chmod 777 /etc/init.d/console
  37. chmod 777 /etc/init.d/reportquery
  38. fi
  39. if [[ -n $(systemctl --version 2>/dev/null | grep systemd) ]]; then
  40. echo "initialize systemd"
  41. systemctl daemon-reload
  42. systemctl enable monitor
  43. systemctl enable console
  44. systemctl enable reportquery
  45. systemctl list-unit-files --type=service | egrep "^console\.|^monitor\.|^reportquery\."
  46. systemctl restart monitor
  47. systemctl restart console
  48. systemctl restart reportquery
  49. else
  50. echo "initialize sysV"
  51. if [[ -n $(chkconfig --version 2>/dev/null) ]]; then
  52. chkconfig monitor on
  53. chkconfig console on
  54. chkconfig reportquery on
  55. chkconfig --list | egrep "^console\s|^monitor\s|^reportquery\s"
  56. else
  57. update-rc.d monitor defaults
  58. update-rc.d console defaults
  59. update-rc.d reportquery defaults
  60. fi
  61. service monitor restart
  62. service console restart
  63. service reportquery restart
  64. fi
  65. echo "Installation is complete!"