|
26 | 26 | wait string
|
27 | 27 | notifyCmd string
|
28 | 28 | notifyOutput bool
|
29 |
| - sighupContainerID string |
30 |
| - notifyContainerID string |
| 29 | + sighupContainerID stringslice |
| 30 | + notifyContainerID stringslice |
31 | 31 | notifyContainerSignal int
|
32 | 32 | notifyContainerFilter mapstringslice = make(mapstringslice)
|
33 | 33 | onlyExposed bool
|
@@ -112,10 +112,10 @@ func initFlags() {
|
112 | 112 | flag.BoolVar(&includeStopped, "include-stopped", false, "include stopped containers")
|
113 | 113 | flag.BoolVar(¬ifyOutput, "notify-output", false, "log the output(stdout/stderr) of notify command")
|
114 | 114 | flag.StringVar(¬ifyCmd, "notify", "", "run command after template is regenerated (e.g `restart xyz`)")
|
115 |
| - flag.StringVar(&sighupContainerID, "notify-sighup", "", |
116 |
| - "send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`") |
117 |
| - flag.StringVar(¬ifyContainerID, "notify-container", "", |
118 |
| - "container to send a signal to") |
| 115 | + flag.Var(&sighupContainerID, "notify-sighup", |
| 116 | + "send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`. You can pass this option multiple times to send HUP to multiple containers.") |
| 117 | + flag.Var(¬ifyContainerID, "notify-container", |
| 118 | + "send -notify-signal signal (defaults to 1 / HUP) to container. You can pass this option multiple times to notify multiple containers.") |
119 | 119 | flag.Var(¬ifyContainerFilter, "notify-filter",
|
120 | 120 | "container filter for notification (e.g -notify-filter name=foo). You can have multiple of these. https://docs.docker.com/engine/reference/commandline/ps/#filter")
|
121 | 121 | flag.IntVar(¬ifyContainerSignal, "notify-signal", int(docker.SIGHUP),
|
@@ -176,11 +176,11 @@ func main() {
|
176 | 176 | Interval: interval,
|
177 | 177 | KeepBlankLines: keepBlankLines,
|
178 | 178 | }
|
179 |
| - if sighupContainerID != "" { |
180 |
| - cfg.NotifyContainers[sighupContainerID] = int(syscall.SIGHUP) |
| 179 | + for _, id := range sighupContainerID { |
| 180 | + cfg.NotifyContainers[id] = int(syscall.SIGHUP) |
181 | 181 | }
|
182 |
| - if notifyContainerID != "" { |
183 |
| - cfg.NotifyContainers[notifyContainerID] = notifyContainerSignal |
| 182 | + for _, id := range notifyContainerID { |
| 183 | + cfg.NotifyContainers[id] = notifyContainerSignal |
184 | 184 | }
|
185 | 185 | if len(notifyContainerFilter) > 0 {
|
186 | 186 | cfg.NotifyContainersFilter = notifyContainerFilter
|
|
0 commit comments