uninstall.sh 537 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. #source var/function
  3. . ./function.sh
  4. echo "My pkg path is ${PKG_PATH}"
  5. check_inst_right
  6. read -p "WARNING: This script is experimental. Press Ctrl+C to cancel or Enter to continue." readEnterKey
  7. case $1 in
  8. 'bin')
  9. echo "Starting binary cleanup"
  10. rm -rf "${PKG_PATH:?}"/bin/*
  11. echo "Binary files have been deleted"
  12. ;;
  13. 'all')
  14. echo "Starting uninstall"
  15. rm -rf "${PKG_PATH:?}"
  16. rm -rf "/usr/bin/${PKG:?}"
  17. echo "Uninstallation has succeed"
  18. ;;
  19. *)
  20. echo "Usage: Please enter a target './uninstall { all | bin }'"
  21. esac