-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
executable file
·59 lines (48 loc) · 1.43 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash -x
mkdir -p /home/test/
mkdir -p /home/students/
mkdir -p /home/speakers/
TEST=`cat /root/core/users/test.txt`
for UP in $TEST;
do
U=`echo $UP | cut -d':' -f1`
P=`echo $UP | cut -d':' -f2`
HOME_DIR=/home/test/$U
echo creating user $U;
echo $U:$P::::$HOME_DIR:/bin/bash | newusers;
# echo Copying class files for user $U
# rsync -a --ignore-existing --exclude=data /opt/issdl/classes/* $HOME_DIR;
chown -R $U:$U $HOME_DIR;
ln -s /opt/issdl/data/ $HOME_DIR/data;
done;
groupadd speakers
SPEAKERS=`cat /root/core/users/speakers.txt`
for UP in $SPEAKERS;
do
U=`echo $UP | cut -d':' -f1`
P=`echo $UP | cut -d':' -f2`
HOME_DIR=/home/speakers/$U
echo creating user $U;
echo $U:$P::::$HOME_DIR:/bin/bash | newusers;
# echo Copying class files for user $U
# rsync -a --ignore-existing --exclude=data /opt/issdl/classes/* $HOME_DIR;
chown -R $U:$U $HOME_DIR;
ln -s /opt/issdl/data/ $HOME_DIR/data;
usermod -a -G speakers $U
done;
STUDENTS=`cat /root/core/users/students.txt`
for UP in $STUDENTS;
do
U=`echo $UP | cut -d':' -f1`
P=`echo $UP | cut -d':' -f2`
HOME_DIR=/home/students/$U
echo creating user $U;
echo $U:$P::::$HOME_DIR:/bin/bash | newusers;
# echo Copying class files for user $U
# rsync -a --ignore-existing --exclude=data /opt/issdl/classes/* $HOME_DIR;
chown -R $U:$U $HOME_DIR;
ln -s /opt/issdl/data/ $HOME_DIR/data;
done;
/root/core/users/speakers_files.sh
#chmod -R o-x /home/
jupyterhub