fix: 文件路径ToSlash去除多斜杠转义

This commit is contained in:
TsMask
2024-05-13 09:40:50 +08:00
parent 9522e6f879
commit cf11242699
3 changed files with 4 additions and 4 deletions

View File

@@ -461,7 +461,7 @@ func (r *NeInfoImpl) neConfOAMWirte(neType, neId string, content any, sync bool)
// 网元端配置路径
neFilePath := fmt.Sprintf("/usr/local/etc/%s/%s", neTypeLower, fileName)
neFileDir := filepath.Dir(neFilePath)
neFileDir := filepath.ToSlash(filepath.Dir(neFilePath))
// 修改网元文件权限
sshClient.RunCMD(fmt.Sprintf("sudo mkdir -p %s && sudo chmod o+w %s && sudo touch %s && sudo chmod o+w %s", neFileDir, neFileDir, neFilePath, neFilePath))
// 复制到网元进行覆盖