summaryrefslogtreecommitdiff
path: root/build-aux/autodetect-pam-config.py
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/autodetect-pam-config.py')
-rwxr-xr-xbuild-aux/autodetect-pam-config.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/build-aux/autodetect-pam-config.py b/build-aux/autodetect-pam-config.py
new file mode 100755
index 00000000..549186ba
--- /dev/null
+++ b/build-aux/autodetect-pam-config.py
@@ -0,0 +1,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')