summaryrefslogtreecommitdiff
path: root/build-aux/autodetect-pam-config.py
blob: 549186ba86b27d93e3b65ae18e714ab1c58fb421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3

import os;

pam_configs = [('redhat', 'redhat'),
               ('fedora', 'redhat'),
               ('exherbo', 'exherbo'),
               ('arch', 'arch'),
               ('lfs', 'lfs')]

for distro, pam_config in pam_configs:
    release_file = os.path.join('/', 'etc', '{}-release'.format(distro))
    if os.path.exists(release_file):
        print(pam_config)
        exit(0)

print('none')