You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
579 B

package custom
import (
"XProxy/cmd/common"
log "github.com/sirupsen/logrus"
)
type Config struct {
Pre []string `yaml:"pre" json:"pre"`
Post []string `yaml:"post" json:"post"`
}
func RunPreScript(config *Config) {
for _, script := range config.Pre {
log.Infof("Run pre-script command -> %s", script)
common.RunCommand("sh", "-c", script)
}
}
func RunPostScript(config *Config) {
for _, script := range config.Post {
log.Infof("Run post-script command -> %s", script)
common.RunCommand("sh", "-c", script)
}
}