update.sh 717 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. set -e
  3. if [ $UID -ne 0 ]; then
  4. echo "请用root用户运行当前脚本 (su root)" && exit 1
  5. fi
  6. config_dir="/opt/minio-into-stck/minio-into-stck/config"
  7. if [ ! -d "$config_dir" ]; then
  8. echo "配置文件夹不存在,请检查是否安装了minio-into-stck"
  9. exit
  10. fi
  11. echo "正在更新minio-into-stck..."
  12. rm -rf /tmp/minio-into-stck-tmp
  13. mkdir -p /tmp/minio-into-stck-tmp
  14. cp -rf $config_dir /tmp/minio-into-stck-tmp
  15. ./uninstall.sh
  16. ./install.sh
  17. echo "正在恢复配置文件..."
  18. rsync -a --delete /tmp/minio-into-stck-tmp/config/ "$config_dir"
  19. chmod 777 -R $config_dir
  20. rm -rf /tmp/minio-into-stck-tmp
  21. echo "更新完成!"
  22. systemctl start minio-into-stck
  23. echo "minio-into-stck已启动"