mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
Added checking the /etc/os-release file
I'm using an arch-based distribution in which does not have an arch-release file but has an ID_LIKE line in os-release
This commit is contained in:
@@ -48,6 +48,12 @@ def get_distro():
|
|||||||
if os.path.exists('/etc/arch-release'):
|
if os.path.exists('/etc/arch-release'):
|
||||||
return 'arch'
|
return 'arch'
|
||||||
|
|
||||||
|
if os.path.exists('/etc/os-release'):
|
||||||
|
with open('/etc/os-release', 'r') as os_release_file:
|
||||||
|
for line in os_release_file:
|
||||||
|
if 'ID_LIKE=arch' in line:
|
||||||
|
return 'arch'
|
||||||
|
|
||||||
if os.path.exists('/proc/version'):
|
if os.path.exists('/proc/version'):
|
||||||
if 'ubuntu' in run_cmd('cat /proc/version').lower():
|
if 'ubuntu' in run_cmd('cat /proc/version').lower():
|
||||||
return 'ubuntu'
|
return 'ubuntu'
|
||||||
|
|||||||
Reference in New Issue
Block a user