-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_chamber.bash
executable file
·69 lines (60 loc) · 1.33 KB
/
new_chamber.bash
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
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Script used to make a new chamber folder
# Prompt for a reply of whether to continue or not
prompt(){
continue="k"
while [ $continue != "y" ] && [ $continue != "n" ];do
read -n 1 continue
echo -en "\b"
done
if [ $continue == "y" ];then
echo -e "yes\n"
else
echo -e "no\nEXITING. Aborted by user! \n"
exit 2
fi
}
if [ $# -ne 1 ]; then
echo "This script needs exactly one argument, the folder name for the new chamber, to proceed"
exit 30
fi
echo "Make new folder named: $1"
echo "Ok to preceed (y/n)?"
mkdir $1
prompt
cd $1
echo "Current folder is: "`pwd`
echo "Ready to make links (y/n)?"
prompt
echo "Linking python files"
ln -s ../sym-files2/*.py .
if [ $? -eq 0 ]; then
echo -e "...OK\n\n"
else
echo "Something went wrong with the links. Exiting!"
exit 12
fi
echo "Linking php files"
ln -s ../sym-files2/*.php .
if [ $? -eq 0 ]; then
echo -e "...OK\n\n"
else
echo "Something went wrong with the links. Exiting!"
exit 12
fi
echo "Linking dygraph"
ln -s ../sym-files2/dygraph .
if [ $? -eq 0 ]; then
echo -e "...OK\n\n"
else
echo "Something went wrong with the links. Exiting!"
exit 12
fi
echo "Linking dygraphs"
ln -s ../sym-files2/dygraphs
if [ $? -eq 0 ]; then
echo -e "...OK\n\n"
else
echo "Something went wrong with the links. Exiting!"
exit 12
fi