forked from bsmithyman/jupyterhub-ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
executable file
·44 lines (37 loc) · 922 Bytes
/
startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
export CONF=/etc/ldap.conf
if [ "$BASE" ]; then
sed -i "/^base.*$/d" $CONF
echo "base $BASE" >> $CONF
fi
if [ "$URI" ]; then
sed -i "/^uri.*$/d" $CONF
echo "uri $URI" >> $CONF
fi
if [ "$BINDDN" ]; then
sed -i "/^binddn.*$/d" $CONF
echo "binddn $BINDDN" >> $CONF
fi
if [ "$BINDPW" ]; then
sed -i "/^bindpw.*$/d" $CONF
echo "bindpw $BINDPW" >> $CONF
fi
cat >> $CONF << END
pam_password crypt
END
if [ "$AD" ]; then
cat >> $CONF << END
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_attribute uid sAMAccountName
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute shadowLastChange pwdLastSet
nss_map_objectclass posixGroup group
nss_map_attribute uniqueMember member
pam_login_attribute sAMAccountName
pam_filter objectclass=User
pam_password ad
END
fi
chmod 777 /home
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py --no-ssl