-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·61 lines (54 loc) · 1.74 KB
/
setup.sh
File metadata and controls
executable file
·61 lines (54 loc) · 1.74 KB
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
59
60
#!/bin/sh
cd `dirname $0`
if [ ! -f ./config/biocore.cfg ]
then
echo "ERROR: ./config/biocore.cfg not found "
exit 1
fi
WS_USER_NAME=$1
if [ -z "$WS_USER_NAME" ]
then
echo ""
echo "Usage: ./setup.sh user_name"
echo "Where: user_name is a word composition of your first name and the "
echo " first character of your last name - all in lowercase. "
echo " For example: the user_name for Lucie Hutchins would be lucieh "
echo ""
exit 1
fi
source ./config/biocore.cfg
source ./config/.users.cfg
##Create user's working directory under
## ec2-user's home --
S3_USER_BASE=$MINOTA_BASE/$WS_USER_NAME
USER_BASE=~/$WS_USER_NAME
if [ ${USERS[$WS_USER_NAME]+abc} ]
then
[ ! -d $USER_BASE ] && mkdir $USER_BASE
[ ! -d $S3_USER_BASE ] && mkdir $S3_USER_BASE
user_name=${USERS[$WS_USER_NAME]}
mkdir $USER_BASE/workshop_src
cp -R tools/* $USER_BASE/workshop_src/
echo "**********************************************"
echo ""
echo "$user_name, Welcome to MINOTA 2019!"
echo ""
echo "**********************************************"
echo "Please Note:"
echo "Your working directory is: $USER_BASE"
echo "Your local copy of workshop Scripts: $USER_BASE/workshop_src "
echo ""
echo "To get started, next run the command: cd $USER_BASE "
echo ""
echo "And Voila!"
echo ""
echo "FYI:"
echo "$USER_BASE is not a persistent storage - will be destroyed if the machine is terminated."
echo "However, you can make $USER_BASE persistent by copying its content to $S3_USER_BASE"
echo ""
else
echo "Bad username:$WS_USER_NAME - Check that your username is all in lowercase and follow the format: "
echo "first_name followed by the first character of your last_name"
exit 1
fi
exit 0