install.sh 687 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. if [ $UID -ne 0 ]; then
  3. echo "请用root用户运行当前脚本 (su root)" && exit 1
  4. fi
  5. if [ -r /opt/minio-store/minio-store ];then
  6. echo "/opt/minio-store/minio-store文件夹已存在,请重命名旧版本文件后再尝试"
  7. exit
  8. fi
  9. root_dir=/opt/minio-store
  10. if [ ! -d "$root_dir" ]; then
  11. mkdir -p $root_dir
  12. fi
  13. tar zxf ./minio-store.tar.gz -C $root_dir
  14. cp -f minio-store.service /usr/lib/systemd/system/
  15. if [ ! -r /opt/minio-store/minio-store ];then
  16. echo "安装失败!"
  17. exit
  18. else
  19. echo "安装成功!"
  20. fi
  21. chmod +x /opt/minio-store/minio-store/*.sh
  22. chmod +x /opt/minio-store/minio-store/bin/*
  23. systemctl daemon-reload