Skip to content

Commit 9626f35

Browse files
committed
LE systemd check
1 parent 4d16d41 commit 9626f35

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

libs/platform.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import xbmcgui
2727
import xbmcvfs
2828
import xbmcaddon
29-
from libs.utility import debugTrace, errorTrace, infoTrace, infoPrint, enum
29+
from libs.utility import debugTrace, errorTrace, infoTrace, newPrint, infoPrint, enum
3030
from sys import platform
3131

3232

@@ -68,8 +68,16 @@ def getPlatform():
6868

6969
def supportSystemd():
7070
if fakeSystemd() : return True
71-
# <FIXME> Check we're on LE
72-
return xbmcvfs.exists(getSystemdPath("system.d/"))
71+
# Only supporting systemd VPN connection on LibreELEC
72+
if getPlatform() == platforms.LINUX:
73+
os_info = open("etc/os-release", 'r')
74+
lines = os_info.readlines()
75+
os_info.close()
76+
for line in lines:
77+
if "LibreELEC" in line:
78+
# Shouldn't really need to check this as LibreELEC comes with systemd installed
79+
return xbmcvfs.exists(getSystemdPath("system.d/"))
80+
return False
7381

7482

7583
def copySystemdFiles():

libs/platform.pyo

224 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)