summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/leap/bitmask/vpn/manager.py2
-rw-r--r--src/leap/bitmask/vpn/service.py5
-rw-r--r--src/leap/bitmask/vpn/vpn.py8
3 files changed, 12 insertions, 3 deletions
diff --git a/src/leap/bitmask/vpn/manager.py b/src/leap/bitmask/vpn/manager.py
index 66fc3d5..1c07976 100644
--- a/src/leap/bitmask/vpn/manager.py
+++ b/src/leap/bitmask/vpn/manager.py
@@ -41,7 +41,6 @@ class TunnelManager(object):
((ip1, portA), (ip2, portB), ...)
:type remotes: tuple of tuple(str, int)
"""
- print "INIT", remotes
# TODO we can set all the needed ports, gateways and paths in here
# TODO need gateways here
# sorting them doesn't belong in here
@@ -65,7 +64,6 @@ class TunnelManager(object):
Start the VPN process.
"""
result = self._vpn.start()
- print "RESULT START --->", result
return result
def stop(self):
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 026f459..ec9e065 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -93,7 +93,10 @@ class VPNService(HookableService):
if self._started:
self._vpn.stop()
self._started = False
- return {'result': 'stopped'}
+ return {'result': 'vpn stopped'}
+ elif self._vpn.is_firewall_up():
+ self._vpn.stop_firewall()
+ return {'result': 'firewall stopped'}
else:
raise Exception('VPN was not running')
diff --git a/src/leap/bitmask/vpn/vpn.py b/src/leap/bitmask/vpn/vpn.py
index 5c9e46e..d32d534 100644
--- a/src/leap/bitmask/vpn/vpn.py
+++ b/src/leap/bitmask/vpn/vpn.py
@@ -16,6 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import commands
+
from colorama import Fore
from leap.bitmask.util import merge_status
@@ -68,6 +70,12 @@ class VPNManager(object):
print(Fore.GREEN + "VPN: stopped." + Fore.RESET)
return True
+ def stop_firewall(self):
+ self._firewall.stop()
+
+ def is_firewall_up(self):
+ return self._firewall.is_up()
+
def get_status(self):
childrenStatus = {
"vpn": self._vpn.status,