Ejemplo n.º 1
0
def writeVPNLog():
    # Write the openvpn output log to the error file
    try:
        log_file = open(getVPNLogFilePath(), 'r')
        log_output = log_file.readlines()
        log_file.close()
        infoTrace("platform.py", "VPN log file start >>>")
        for line in log_output:
            infoPrint(line)
        infoTrace("platform.py", "<<< VPN log file end")
    except Exception as e:
        errorTrace("platform.py", "Couldn't write VPN error log")
        errorTrace("platform.py", str(e))
Ejemplo n.º 2
0
def writeTestFile():
    # Write the command test output to the error file
    try:
        log_file = open(getTestFilePath(), 'r')
        log_output = log_file.readlines()
        log_file.close()
        infoTrace("vpnplatform.py", "Command test file start >>>")
        for line in log_output:
            infoPrint(line)
        infoTrace("vpnplatform.py", "<<< Command test file end")
    except Exception as e:
        errorTrace("vpnplatform.py", "Couldn't write test file")
        errorTrace("vpnplatform.py", str(e))
Ejemplo n.º 3
0
def writeVPNLog():
    # Write the openvpn output log to the error file
    try:
        if xbmcvfs.exists(getVPNLogFilePath()):
            log_file = open(getVPNLogFilePath(), 'r')
            log_output = log_file.readlines()
            log_file.close()
            infoTrace("vpnplatform.py", "VPN log file start >>>")
            for line in log_output:
                line = line.strip("\n")
                infoPrint(line)
            infoTrace("vpnplatform.py", "<<< VPN log file end")
        else:
            infoTrace("vpnplatform.py", "No VPN log file exists to write")
    except Exception as e:
        errorTrace("vpnplatform.py", "Couldn't write VPN error log")
        errorTrace("vpnplatform.py", str(e))
Ejemplo n.º 4
0
def writeVPNConfiguration(ovpn):
    # Write the openvpn configuration to the error file
    try:
        if xbmcvfs.exists(ovpn):
            ovpn_file = open(ovpn, 'r')
            ovpn_output = ovpn_file.readlines()
            ovpn_file.close()
            infoTrace("vpnplatform.py", "VPN configuration " + ovpn + " start >>>")
            for line in ovpn_output:
                line = line.strip("\n")
                infoPrint(line)
            infoTrace("vpnplatform.py", "<<< VPN configuration file end")
        else:
            infoTrace("vpnplatform.py", "No VPN configuration " + ovpn + " exists to write")
    except Exception as e:
        errorTrace("vpnplatform.py", "Couldn't write VPN error log")
        errorTrace("vpnplatform.py", str(e))