Skip to content

Commit

Permalink
fix : minor edit in network_control function #35
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Dec 30, 2020
1 parent 20be870 commit e8e47b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion orangetool/orangetool_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ def network_control(command, device="eth0", debug=False):
cmd = "up"
if command == "down":
cmd = "down"
output = sub.Popen(["ifconfig", device, cmd],
cmd_out = sub.Popen(["ifconfig", device, cmd],
stderr=sub.PIPE, stdin=sub.PIPE, stdout=sub.PIPE)
output = list(cmd_out.communicate())
if len(output[0]) == 0 and len(output[1]) == 0:
return True
return False
Expand Down

0 comments on commit e8e47b5

Please sign in to comment.