@@ -36,6 +36,7 @@ func processTemplateFile(templateFile, destFile string, data interface{}) error
|
|||||||
_, err = os.Stat(dir)
|
_, err = os.Stat(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
|
// #nosec G301
|
||||||
err = os.MkdirAll(dir, 0770)
|
err = os.MkdirAll(dir, 0770)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ func doMain() error {
|
|||||||
// Check whether they only want debug info
|
// Check whether they only want debug info
|
||||||
if *infoFlag {
|
if *infoFlag {
|
||||||
logVersionInfo()
|
logVersionInfo()
|
||||||
logContainerDetails()
|
err = logContainerDetails()
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error displaying container details: %v", err)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ func verifySingleProcess() error {
|
|||||||
|
|
||||||
// Verifies that there is only one instance running of the given program name.
|
// Verifies that there is only one instance running of the given program name.
|
||||||
func verifyOnlyOne(programName string) (int, error) {
|
func verifyOnlyOne(programName string) (int, error) {
|
||||||
|
// #nosec G104
|
||||||
out, _, _ := command.Run("ps", "-e", "--format", "cmd")
|
out, _, _ := command.Run("ps", "-e", "--format", "cmd")
|
||||||
//if this goes wrong then assume we are the only one
|
//if this goes wrong then assume we are the only one
|
||||||
numOfProg := strings.Count(out, programName)
|
numOfProg := strings.Count(out, programName)
|
||||||
|
|||||||
Reference in New Issue
Block a user