uninstall-init.in 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. ################################################################################
  3. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. ################################################################################
  17. ###<REPLACE>###
  18. source ${INSTALL_DIR}/etc/init.d/hpcc_common
  19. source ${INSTALL_DIR}/etc/init.d/init-functions
  20. removeSymlink ()
  21. {
  22. toDelete=$1
  23. rm -f ${toDelete} 2> /dev/null
  24. printf "Removing Symlink %-44s ..." "${toDelete}"
  25. if [ -L ${toDelete} ]; then
  26. log_failure_msg
  27. elif [ -e ${toDelete} ] && [ ! -L ${toDelete} ] ; then
  28. log_failure_msg
  29. else
  30. log_success_msg
  31. fi
  32. }
  33. if [ -e /etc/systemd/system/hpccsystems-platform.target ]; then
  34. removeSymlink "/etc/systemd/system/hpccsystems-platform.target"
  35. fi
  36. echo ""
  37. ## uninstalling files
  38. removeSymlink "/etc/init.d/dafilesrv"
  39. removeSymlink "/usr/bin/dfuplus"
  40. removeSymlink "/usr/bin/ecl"
  41. removeSymlink "/usr/bin/eclcc"
  42. removeSymlink "/usr/bin/eclplus"
  43. removeSymlink "/usr/bin/soapplus"
  44. removeSymlink "/usr/bin/testsocket"
  45. removeSymlink "/usr/bin/wuget"
  46. if [ -d ${INSTALL_DIR}/etc/bash_completion.d ] && [ -d /etc/bash_completion.d ]; then
  47. for subInstall in $(ls ${INSTALL_DIR}/etc/bash_completion.d | grep -v dpkg-tmp); do
  48. removeSymlink /etc/bash_completion.d/$subInstall
  49. done
  50. fi
  51. # locate sub uninstall files.
  52. if [ -d ${INSTALL_DIR}/etc/init.d/uninstall ]; then
  53. for subUnInstall in $(ls ${INSTALL_DIR}/etc/init.d/uninstall); do
  54. source ${INSTALL_DIR}/etc/init.d/uninstall/${subUnInstall}
  55. done
  56. fi
  57. if which systemctl 1>/dev/null 2>&1; then
  58. systemctl daemon-reload
  59. systemctl reset-failed
  60. fi