def switchService(): debugTrace("Switching monitor state, current state is " + getVPNMonitorState()) if isVPNMonitorRunning(): setVPNMonitorState("Stopped") addon.setSetting("monitor_paused", "true") infoTrace("addon.py", "VPN monitor service paused") else: setVPNMonitorState("Started") addon.setSetting("monitor_paused", "false") infoTrace("addon.py", "VPN monitor service restarted") xbmc.executebuiltin('Container.Refresh') return
xbmcgui.Dialog().ok( addon_name, "The VPN connection you were using previously is no longer available. Please re-validate the connections using the available connections." ) cleanPassFiles() removeGeneratedFiles() resetVPNConfig(addon, 1) # Need to go and request the main loop fetches the settingss updateService() reconnect_vpn = False warned_monitor = False if addon.getSetting("monitor_stopped") == "false": warned_monitor = True setVPNMonitorState("Started") else: setVPNMonitorState("Stopped") # Retry time in seconds connection_retry_time = 3600 timer = 0 cycle_timer = 0 last_cycle = "" delay = 5 connection_errors = 0 stop = False vpn_setup = True vpn_provider = "" playing = False
if not primary_path == "" and not xbmcvfs.exists(primary_path): infoTrace("service.py", "New install, but was using good VPN previously. Regenerate OVPNs") if not generateOVPNFiles(getVPNLocation(addon.getSetting("vpn_provider_validated")), addon.getSetting("vpn_locations_list")) or not xbmcvfs.exists(primary_path): xbmcgui.Dialog().ok(addon_name, "The VPN connection you were using previously is no longer available. Please re-validate the connections using the available connections.") cleanPassFiles() removeGeneratedFiles() resetVPNConfig(addon, 1) # Need to go and request the main loop fetches the settings updateService() reconnect_vpn = False warned_monitor = False if addon.getSetting("monitor_paused") == "false": warned_monitor = True setVPNMonitorState("Started") else: setVPNMonitorState("Stopped") # Timer values in seconds connection_retry_time = 3600 timer = 0 cycle_timer = 0 reboot_timer = 0 seconds_to_reboot_check = 0 reboot_time = "" reboot_day = "" last_file_check_time = 0 last_cycle = "" delay = 5