add support for overriding service templates at runtime
This commit is contained in:
committed by
Daniel Theophanes
parent
994866c14a
commit
e5178e50d2
@@ -52,8 +52,15 @@ func (s *systemd) configPath() (cp string, err error) {
|
||||
cp = "/etc/systemd/system/" + s.Config.Name + ".service"
|
||||
return
|
||||
}
|
||||
|
||||
func (s *systemd) template() *template.Template {
|
||||
return template.Must(template.New("").Funcs(tf).Parse(systemdScript))
|
||||
customScript := s.Option.string(optionSystemdScript, "")
|
||||
|
||||
if customScript != "" {
|
||||
return template.Must(template.New("").Funcs(tf).Parse(customScript))
|
||||
} else {
|
||||
return template.Must(template.New("").Funcs(tf).Parse(systemdScript))
|
||||
}
|
||||
}
|
||||
|
||||
func (s *systemd) Install() error {
|
||||
|
||||
Reference in New Issue
Block a user