s6-netdev/bundle.go

31 lines
762 B
Go

package s6netdev
import (
"fmt"
)
func (t *S6SvcTree) netdevCreateBundleAll(ifsvc *S6Svc) *S6Svc {
bundle_name := S6SvcName("bundle.s6netdev")
b := t.S6New(bundle_name, &S6SvcTypes.Bundle)
b.S6Children(ifsvc)
return b
}
func (t *S6SvcTree) netdevCreateBundleStage(iface, stage string) *S6Svc {
bundle_name := S6SvcName(fmt.Sprintf("bundle.interface.%s", iface))
stage_name := S6SvcName(fmt.Sprintf("%s.%s", bundle_name, stage))
b := t.S6New(bundle_name, &S6SvcTypes.Bundle)
t.netdevCreateBundleAll(b)
s := t.S6New(stage_name, &S6SvcTypes.Bundle)
b.S6Children(s)
return s
}
func (t *S6SvcTree) NetdevDependBundleStage(iface, stage string, svcs ...*S6Svc) *S6Svc {
b := t.netdevCreateBundleStage(iface, stage)
b.S6Children(svcs...)
return b
}