uninstall.sh 434 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. if [ $UID -ne 0 ]; then
  3. echo "请用root用户运行当前脚本 (su root)" && exit 1
  4. fi
  5. root_dir=/opt/minio-store
  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-store
  15. rm -rf $root_dir
  16. rm -f /usr/lib/systemd/system/minio-store.service
  17. echo "卸载成功!"
  18. systemctl daemon-reload