fix: 网元授权文件目录权限修改775

This commit is contained in:
TsMask
2024-05-15 09:42:02 +08:00
parent f49d62a160
commit f88100542b

View File

@@ -166,7 +166,7 @@ func (r *NeLicenseImpl) UploadLicense(neLicense model.NeLicense) error {
neLicensePath := fmt.Sprintf("/usr/local/etc/%s/license/system.ini", neTypeLower)
neLicenseDir := filepath.ToSlash(filepath.Dir(neLicensePath))
// 修改网元文件权限
sshClient.RunCMD(fmt.Sprintf("sudo chmod 775 %s && sudo chmod o+w %s", neLicenseDir, neLicensePath))
sshClient.RunCMD(fmt.Sprintf("sudo mkdir -p %s && sudo chmod 775 %s && sudo touch %s && sudo chmod o+rw %s", neLicenseDir, neLicenseDir, neLicensePath, neLicensePath))
// 尝试备份授权文件
neLicensePathBack := fmt.Sprintf("%s/system_%s.ini", neLicensePath, time.Now().Format("20060102_150405"))