-
Notifications
You must be signed in to change notification settings - Fork 3
/
CONFIG
executable file
·94 lines (69 loc) · 2.62 KB
/
CONFIG
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
TESTING=false
# save working directory
WD=(pwd)
# define constants
ROOT_DIR=$(cat var/root_dir)
WEB_DIR=/var/www/html/wormbot
CGI_DIR=$ROOT_DIR/cgi-bin
GRAPHS_DIR=$ROOT_DIR/graphs
SCHEDULER_DIR=$ROOT_DIR/scheduler_parts
# handle installation directory
if [ "$#" -eq 1 ]
then
ROOT_DIR=$1
echo $ROOT_DIR > var/root_dir
elif [ "$#" -gt 1 ]
then
echo "Usage: $0 [DIR]"
exit
fi
# setup directories in root
if [ ! -d "/wormbot" ]; then
sudo mkdir $ROOT_DIR #this needs to be setup already in the LVM...should just symlink it but if it's not there we need to make it
fi
sudo mkdir $GRAPHS_DIR
sudo chmod a+wr $GRAPHS_DIR
sudo mkdir $SCHEDULER_DIR
sudo chmod a+wr $SCHEDULER_DIR
sudo mkdir $CGI_DIR #make the password protected CGI-bin
#sudo mkdir $WEB_DIR
sudo ln --symbolic $ROOT_DIR $WEB_DIR
#sudo ln --symbolic -T $ROOT_DIR/experiments $WEB_DIR/experiments
#sudo ln --symbolic $WEB_DIR /var/www/html/wormbot
sudo chmod a+rw $WEB_DIR
sudo echo ,,,,,,, > $ROOT_DIR/RRRjoblist.csv
sudo chmod a+rw $ROOT_DIR/RRRjoblist.csv
# move necessary files to root dir
sudo cp camera.config experimentuploader.html graphmaker.html platecoordinates.dat generate_coordinates.py bin/alignerd bin/controller wormbot_template.csv bin/master_control_program security/.htpasswd $ROOT_DIR
sudo echo 0 > $ROOT_DIR/currexpid.dat
sudo chmod a+rw $ROOT_DIR/currexpid.dat
# move necessary files to web dir
sudo cp -r img $WEB_DIR/img
sudo cp plateform.html $WEB_DIR
sudo cp www/html/status.html $WEB_DIR
# move necessary files to cgi-bin
sudo cp data_path bin/experimentbrowser bin/marker bin/scheduler bin/cgiccretro bin/wormlistupdater bin/backupexperiment bin/deleteexperiment bin/wormbotstatus bin/graphmaker bin/cropFrames $CGI_DIR
sudo cp ../ffmpeg-3.4/ffmpeg $CGI_DIR
sudo cp data_path /usr/lib/cgi-bin #this is for compatibilty following security changes to move cgi bin into /wormbot
# move retrograde files to the web html retrograde directory
sudo cp -r retrograde/ /var/www/html/
# move scheduler_component stuff
sudo cp scheduler_component/* $SCHEDULER_DIR
# move script for wormbot in command-line
sudo cp bin/wormbot /bin
#move launch script to /etc/rc.local
sudo head -n -1 /etc/rc.local > /tmp/temp.rc.local ; mv /tmp/temp.rc.local /etc/rc.local
sudo echo "/wormbot/master_control_program" >> /etc/rc.local
sudo echo "exit 0" >> /etc/rc.local
sudo chmod +x /etc/rc.local
sudo systemctl enable rc-local.service
if $TESTING ;
then
echo testing
cp -r test_data/* $ROOT_DIR/experiments
sudo echo 1 > $ROOT_DIR/experiments/currexpid.dat
fi
sudo chmod -R +rw $WEB_DIR
sudo cp security/apache2.conf /etc/apache2/apache2.conf
sudo service apache2 restart