install.sh 749 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-into-stck/minio-into-stck ];then
  6. echo "/opt/minio-into-stck/minio-into-stck文件夹已存在,请重命名旧版本文件后再尝试"
  7. exit
  8. fi
  9. root_dir=/opt/minio-into-stck
  10. if [ ! -d "$root_dir" ]; then
  11. mkdir -p $root_dir
  12. fi
  13. tar zxf ./minio-into-stck.tar.gz -C $root_dir
  14. cp -f minio-into-stck.service /usr/lib/systemd/system/
  15. if [ ! -r /opt/minio-into-stck/minio-into-stck ];then
  16. echo "安装失败!"
  17. exit
  18. else
  19. echo "安装成功!"
  20. fi
  21. chmod +x /opt/minio-into-stck/minio-into-stck/*.sh
  22. chmod +x /opt/minio-into-stck/minio-into-stck/minio-into-stck
  23. systemctl daemon-reload