-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #21 Adds no-op commands for `killall` and `pkill` like the existing `kill`. These are some of the highest ranking missing commands with nearly 100 invocations each over the last couple of days.
- Loading branch information
1 parent
dd47316
commit 41b0936
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/josephlewis42/honeyssh/core/vos" | ||
) | ||
|
||
// Killall implements a no-op killall command. | ||
func Killall(virtOS vos.VOS) int { | ||
cmd := &SimpleCommand{ | ||
Use: "killall [OPTION]... [--] NAME...", | ||
Short: "Kill a process by name.", | ||
// Never bail, even if args are bad. | ||
NeverBail: true, | ||
} | ||
|
||
return cmd.Run(virtOS, func() int { | ||
// No-op. | ||
return 0 | ||
}) | ||
} | ||
|
||
var _ vos.ProcessFunc = Killall | ||
|
||
func init() { | ||
addBinCmd("killall", Killall) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/josephlewis42/honeyssh/core/vos" | ||
) | ||
|
||
// Pkill implements a no-op pkill command. | ||
func Pkill(virtOS vos.VOS) int { | ||
cmd := &SimpleCommand{ | ||
Use: "pkill [OPTION]... PATTERN", | ||
Short: "Signal a process by pattern", | ||
// Never bail, even if args are bad. | ||
NeverBail: true, | ||
} | ||
|
||
return cmd.Run(virtOS, func() int { | ||
// No-op. | ||
return 0 | ||
}) | ||
} | ||
|
||
var _ vos.ProcessFunc = Pkill | ||
|
||
func init() { | ||
addBinCmd("pkill", Pkill) | ||
} |