uninstall.sh 480 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. if [ $UID -ne 0 ]; then
  3. echo "请用root用户运行当前脚本 (su root)" && exit 1
  4. fi
  5. root_dir=/opt/minio-into-stck
  6. if [ ! -d "$root_dir" ]; then
  7. mkdir -p $root_dir
  8. fi
  9. # Don't delete `/`
  10. if [[ $root_dir == "/" ]]; then
  11. echo "root_dir is /, exit"
  12. exit 1
  13. fi
  14. systemctl stop minio-into-stck
  15. systemctl disable minio-into-stck
  16. rm -rf $root_dir
  17. rm -f /usr/lib/systemd/system/minio-into-stck.service
  18. echo "卸载成功!"
  19. systemctl daemon-reload