source: lliurex-enterprise-mount/trunk/fuentes/install-files/usr/share/libpam-script/pam_script_ses_open @ 1012

Last change on this file since 1012 was 1012, checked in by jrpelegrina, 4 years ago

First release to xenial

  • Property svn:executable set to *
File size: 875 bytes
Line 
1#!/usr/bin/env python
2import subprocess
3import sys
4import os
5
6if os.path.exists("/usr/bin/domainjoin-cli"):
7        output=subprocess.Popen(["domainjoin-cli query | grep Domain"],shell=True,stdout=subprocess.PIPE).communicate()[0]
8else:
9        output=""
10pam_user=os.environ["PAM_USER"]
11
12EDU="/usr/share/lliurex-enterprise-mount/scripts/lliurex-edu-gva"
13GVA="/usr/share/lliurex-enterprise-mount/scripts/lliurex-gva"
14COMMON="/usr/share/lliurex-enterprise-mount/scripts/lliurex-enterprise-mount-common"
15
16if "EDU.GVA.ES" in output:
17        if os.path.exists(EDU):
18                os.system("PAM_USER=%s %s %s"%(pam_user,COMMON,EDU))
19        else:
20                os.system("PAM_USER=%s %s"%(pam_user,COMMON))
21               
22#elif "GVA.ES" in output:
23#       if os.path.exists(GVA):
24#               os.system("PAM_USER=%s %s"%(pam_user,GVA))
25#       else:
26#               os.system("PAM_USER=%s %s"%(pam_user,COMMON))
27else:
28        os.system("PAM_USER=%s %s"%(pam_user,COMMON))
29       
30sys.exit(0)
Note: See TracBrowser for help on using the repository browser.