OpenSecurity/bin/terminate_client_tray.pyw
author Oliver Maurhart <oliver.maurhart@ait.ac.at>
Mon, 29 Sep 2014 12:46:51 +0200
changeset 226 107dc235508f
child 240 d7ef04254e9c
permissions -rw-r--r--
added tray client termination support for uninstall
oliver@226
     1
# -*- coding: utf-8 -*-
oliver@226
     2
oliver@226
     3
# ------------------------------------------------------------
oliver@226
     4
# terminate the client tray
oliver@226
     5
# 
oliver@226
     6
# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
oliver@226
     7
#
oliver@226
     8
# Copyright (C) 2014 AIT Austrian Institute of Technology
oliver@226
     9
# AIT Austrian Institute of Technology GmbH
oliver@226
    10
# Donau-City-Strasse 1 | 1220 Vienna | Austria
oliver@226
    11
# http://www.ait.ac.at
oliver@226
    12
#
oliver@226
    13
# This program is free software; you can redistribute it and/or
oliver@226
    14
# modify it under the terms of the GNU General Public License
oliver@226
    15
# as published by the Free Software Foundation version 2.
oliver@226
    16
# 
oliver@226
    17
# This program is distributed in the hope that it will be useful,
oliver@226
    18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
oliver@226
    19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
oliver@226
    20
# GNU General Public License for more details.
oliver@226
    21
# 
oliver@226
    22
# You should have received a copy of the GNU General Public License
oliver@226
    23
# along with this program; if not, write to the Free Software
oliver@226
    24
# Foundation, Inc., 51 Franklin Street, Fifth Floor, 
oliver@226
    25
# Boston, MA  02110-1301, USA.
oliver@226
    26
# ------------------------------------------------------------
oliver@226
    27
oliver@226
    28
oliver@226
    29
# ------------------------------------------------------------
oliver@226
    30
# imports
oliver@226
    31
oliver@226
    32
import urllib2
oliver@226
    33
oliver@226
    34
oliver@226
    35
# ------------------------------------------------------------
oliver@226
    36
# code
oliver@226
    37
oliver@226
    38
oliver@226
    39
# start
oliver@226
    40
if __name__ == "__main__":
oliver@226
    41
oliver@226
    42
    try:
oliver@226
    43
oliver@226
    44
        # TODO: HARDCODED ADDRESS OF OPENSECURITY CLIENT TRAY
oliver@226
    45
        browsing_vm = urllib2.urlopen('http://127.0.0.1:8090/quit').readline()
oliver@226
    46
        print('Called http://127.0.0.1:8090/quit')
oliver@226
    47
        
oliver@226
    48
    except Exception as e:
oliver@226
    49
        print('Failed: %s' % (e.message))
oliver@226
    50
        
oliver@226
    51