mirror of https://github.com/dnomd343/XProxy.git
dnomd343
2 years ago
5 changed files with 39 additions and 18 deletions
@ -0,0 +1,25 @@ |
|||||
|
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) |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue