mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
Advise user to perform a reload when appropriate (#163)
This commit is contained in:
parent
b19046939c
commit
f8abb01bbc
5 changed files with 16 additions and 3 deletions
|
@ -65,6 +65,9 @@ you should [update cscli](./cscli_update.md).
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
log.Infof("Run 'systemctl reload crowdsec' for the new configuration to be effective.")
|
||||||
|
},
|
||||||
}
|
}
|
||||||
cmdInstall.PersistentFlags().BoolVarP(&download_only, "download-only", "d", false, "Only download packages, don't enable")
|
cmdInstall.PersistentFlags().BoolVarP(&download_only, "download-only", "d", false, "Only download packages, don't enable")
|
||||||
cmdInstall.PersistentFlags().BoolVar(&force_install, "force", false, "Force install : Overwrite tainted and outdated files")
|
cmdInstall.PersistentFlags().BoolVar(&force_install, "force", false, "Force install : Overwrite tainted and outdated files")
|
||||||
|
|
|
@ -58,6 +58,9 @@ func NewRemoveCmd() *cobra.Command {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
log.Infof("Run 'systemctl reload crowdsec' for the new configuration to be effective.")
|
||||||
|
},
|
||||||
}
|
}
|
||||||
cmdRemove.PersistentFlags().BoolVar(&purge_remove, "purge", false, "Delete source file in ~/.cscli/hub/ too")
|
cmdRemove.PersistentFlags().BoolVar(&purge_remove, "purge", false, "Delete source file in ~/.cscli/hub/ too")
|
||||||
cmdRemove.PersistentFlags().BoolVar(&remove_all, "all", false, "Delete all the files in selected scope")
|
cmdRemove.PersistentFlags().BoolVar(&remove_all, "all", false, "Delete all the files in selected scope")
|
||||||
|
|
|
@ -95,7 +95,7 @@ func simulationStatus() error {
|
||||||
|
|
||||||
func NewSimulationCmds() *cobra.Command {
|
func NewSimulationCmds() *cobra.Command {
|
||||||
var cmdSimulation = &cobra.Command{
|
var cmdSimulation = &cobra.Command{
|
||||||
Use: "simulation enable|disable [scenario_name]",
|
Use: "simulation enable|disable [scenario_name]",
|
||||||
Short: "",
|
Short: "",
|
||||||
Long: ``,
|
Long: ``,
|
||||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
@ -104,6 +104,9 @@ func NewSimulationCmds() *cobra.Command {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
log.Infof("Run 'systemctl reload crowdsec' for the new configuration to be effective.")
|
||||||
|
},
|
||||||
}
|
}
|
||||||
cmdSimulation.Flags().SortFlags = false
|
cmdSimulation.Flags().SortFlags = false
|
||||||
cmdSimulation.PersistentFlags().SortFlags = false
|
cmdSimulation.PersistentFlags().SortFlags = false
|
||||||
|
@ -215,6 +218,8 @@ func NewSimulationCmds() *cobra.Command {
|
||||||
log.Fatalf(err.Error())
|
log.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
},
|
||||||
}
|
}
|
||||||
cmdSimulation.AddCommand(cmdSimulationStatus)
|
cmdSimulation.AddCommand(cmdSimulationStatus)
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,9 @@ cscli upgrade --force # Overwrite tainted configuration
|
||||||
}
|
}
|
||||||
//fmt.Println("upgrade all ?!: " + strings.Join(args, " "))
|
//fmt.Println("upgrade all ?!: " + strings.Join(args, " "))
|
||||||
},
|
},
|
||||||
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
log.Infof("Run 'systemctl reload crowdsec' for the new configuration to be effective.")
|
||||||
|
},
|
||||||
}
|
}
|
||||||
cmdUpgrade.PersistentFlags().BoolVar(&upgrade_all, "all", false, "Upgrade all configuration in scope")
|
cmdUpgrade.PersistentFlags().BoolVar(&upgrade_all, "all", false, "Upgrade all configuration in scope")
|
||||||
cmdUpgrade.PersistentFlags().BoolVar(&force_upgrade, "force", false, "Overwrite existing files, even if tainted")
|
cmdUpgrade.PersistentFlags().BoolVar(&force_upgrade, "force", false, "Overwrite existing files, even if tainted")
|
||||||
|
|
|
@ -78,7 +78,6 @@ copy_files() {
|
||||||
cp "./cmd/crowdsec/crowdsec" "$BASE"
|
cp "./cmd/crowdsec/crowdsec" "$BASE"
|
||||||
cp "./cmd/crowdsec-cli/cscli" "$BASE"
|
cp "./cmd/crowdsec-cli/cscli" "$BASE"
|
||||||
cp -r "./config/patterns" "$CONFIG_DIR"
|
cp -r "./config/patterns" "$CONFIG_DIR"
|
||||||
cp -r "./data/" "$BASE"
|
|
||||||
cp -r "./plugins/" "$BASE"
|
cp -r "./plugins/" "$BASE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,4 +115,4 @@ usage() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue