Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chanchal1987 committed Nov 24, 2021
1 parent 7847bca commit 952de10
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pkg/commands/control-sockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,19 @@ func runMasterSocketCommand(_ *cobra.Command, args []string) error {
func runFlushSocketsCommand(_ *cobra.Command, _ []string) error {
success := 0

if processes, err := process.Processes(); err != nil {
processes, err := process.Processes()
if err != nil {
return err
} else {
for _, ps := range processes {
if cmdline, err := ps.CmdlineSlice(); err == nil && len(cmdline) > 0 && path.Base(cmdline[0]) == "assh" && cmdline[1] == "connect" {
cmd := exec.Command("ssh", "-O", "exit", cmdline[len(cmdline)-1]) // #nosec
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

if err := cmd.Run(); err == nil {
success++
}
}

for _, ps := range processes {
if cmdline, err := ps.CmdlineSlice(); err == nil && len(cmdline) > 0 && path.Base(cmdline[0]) == "assh" && cmdline[1] == "connect" {
cmd := exec.Command("ssh", "-O", "exit", cmdline[len(cmdline)-1]) // #nosec
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

if err := cmd.Run(); err == nil {
success++
}
}
}
Expand Down

0 comments on commit 952de10

Please sign in to comment.