|
24 | 24 | wait string
|
25 | 25 | notifyCmd string
|
26 | 26 | notifyOutput bool
|
| 27 | + sighupContainerID string |
27 | 28 | notifyContainerID string
|
28 | 29 | notifyContainerSignal int
|
29 | 30 | onlyExposed bool
|
@@ -96,7 +97,7 @@ func initFlags() {
|
96 | 97 | flag.BoolVar(&includeStopped, "include-stopped", false, "include stopped containers")
|
97 | 98 | flag.BoolVar(¬ifyOutput, "notify-output", false, "log the output(stdout/stderr) of notify command")
|
98 | 99 | flag.StringVar(¬ifyCmd, "notify", "", "run command after template is regenerated (e.g `restart xyz`)")
|
99 |
| - flag.StringVar(¬ifyContainerID, "notify-sighup", "", |
| 100 | + flag.StringVar(&sighupContainerID, "notify-sighup", "", |
100 | 101 | "send HUP signal to container. Equivalent to docker kill -s HUP `container-ID`")
|
101 | 102 | flag.StringVar(¬ifyContainerID, "notify-container", "",
|
102 | 103 | "container to send a signal to")
|
@@ -158,6 +159,9 @@ func main() {
|
158 | 159 | Interval: interval,
|
159 | 160 | KeepBlankLines: keepBlankLines,
|
160 | 161 | }
|
| 162 | + if sighupContainerID != "" { |
| 163 | + cfg.NotifyContainers[sighupContainerID] = int(syscall.SIGHUP) |
| 164 | + } |
161 | 165 | if notifyContainerID != "" {
|
162 | 166 | cfg.NotifyContainers[notifyContainerID] = notifyContainerSignal
|
163 | 167 | }
|
|
0 commit comments