2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 00:49:22 +08:00

fix: s3fs挂载失败删除密码

This commit is contained in:
2026-01-28 07:33:09 +08:00
parent af2d856576
commit fd583ec208

View File

@@ -100,11 +100,13 @@ func (s *App) Create(w http.ResponseWriter, r *http.Request) {
}
if _, err = shell.Execf("mount -a"); err != nil {
_, _ = shell.Execf(`sed -i 's@^s3fs#%s\s%s.*$@@g' /etc/fstab`, req.Bucket, req.Path)
_ = os.Remove("/etc/passwd-s3fs-" + cast.ToString(id))
service.Error(w, http.StatusInternalServerError, "%v", err)
return
}
if _, err = shell.Execf(`df -h | grep '%s'`, req.Path); err != nil {
_, _ = shell.Execf(`sed -i 's@^s3fs#%s\s%s.*$@@g' /etc/fstab`, req.Bucket, req.Path)
_ = os.Remove("/etc/passwd-s3fs-" + cast.ToString(id))
service.Error(w, http.StatusInternalServerError, s.t.Get("mount failed: %v", err))
return
}