Add ability to delete multiple snapshots separated by comma
This commit is contained in:
@ -230,10 +230,11 @@ func deleteJailSnapshot(jail Jail) error {
|
||||
for _, line := range strings.Split(out, "\n") {
|
||||
if len(line) > 0 {
|
||||
ls := strings.Split(line, "@")
|
||||
|
||||
matched, _ := regexp.Match(fmt.Sprintf("^%s(\\/.*)?$", gSnapshotName), []byte(ls[1]))
|
||||
if matched {
|
||||
snaptodel = append(snaptodel, strings.Join(ls, "@"))
|
||||
for _, sn := range strings.Split(gSnapshotName, ",") {
|
||||
matched, _ := regexp.Match(fmt.Sprintf("^%s(\\/.*)?$", sn), []byte(ls[1]))
|
||||
if matched {
|
||||
snaptodel = append(snaptodel, strings.Join(ls, "@"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user