21 lines
392 B
Python
21 lines
392 B
Python
#!/usr/bin/env python3
|
|
import re
|
|
import os.path
|
|
|
|
def _os_flavor():
|
|
|
|
if os.path.isfile('/etc/armbian-release'):
|
|
h = "Armbian"
|
|
elif os.path.isdir('/etc/osmc'):
|
|
h = "OSMC"
|
|
elif os.path.isfile('/etc/octopi_version'):
|
|
h = "OctoPi"
|
|
else:
|
|
h = "Debian"
|
|
return h
|
|
|
|
def main():
|
|
grains = {}
|
|
grains['os_flavor'] = _os_flavor()
|
|
return grains
|