misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-03-27 12:01:13 +02:00
parent 0f8ccf3862
commit a1875e45a2
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

16
main.go
View file

@ -12,10 +12,8 @@ import (
) )
func main() { func main() {
var sess *session.Session sess, err := session.New()
var err error if err != nil {
if sess, err = session.New(); err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
@ -58,12 +56,10 @@ func main() {
log.Fatal("%s", err) log.Fatal("%s", err)
} }
/* // Commands sent with -eval are used to set specific
* Commands sent with -eval are used to set specific // caplet parameters (i.e. arp.spoof.targets) via command
* caplet parameters (i.e. arp.spoof.targets) via command // line, therefore they need to be executed first otherwise
* line, therefore they need to be executed first otherwise // modules might already be started.
* modules might already be started.
*/
for _, cmd := range session.ParseCommands(*sess.Options.Commands) { for _, cmd := range session.ParseCommands(*sess.Options.Commands) {
if err = sess.Run(cmd); err != nil { if err = sess.Run(cmd); err != nil {
log.Error("Error while running '%s': %s", core.Bold(cmd), core.Red(err.Error())) log.Error("Error while running '%s': %s", core.Bold(cmd), core.Red(err.Error()))