Browse code

Return error when iptables is not found

Shawn Siefkas authored on 2013/03/29 04:30:56
Showing 1 changed files
... ...
@@ -70,7 +70,7 @@ func networkSize(mask net.IPMask) (int32, error) {
70 70
 func iptables(args ...string) error {
71 71
 	path, err := exec.LookPath("iptables")
72 72
 	if err != nil {
73
-		log.Fatal("command not found: iptables")
73
+		return fmt.Errorf("command not found: iptables")
74 74
 	}
75 75
 	if err := exec.Command(path, args...).Run(); err != nil {
76 76
 		return fmt.Errorf("iptables failed: iptables %v", strings.Join(args, " "))