-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync.sh
executable file
·194 lines (157 loc) · 4.26 KB
/
sync.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!/bin/bash
#disable blanking
setterm -blank 0
echo getting newest updates
cd /home/turtlebot/scripts/
rm get_file.sh* > /dev/null 2>&1
wget -q https://raw.githubusercontent.com/smARTLab-liv/tbsetup/master/get_file.sh
chmod +x get_file.sh
echo Checking for System Updates
do_reboot=0
#disable wlan save mode
/sbin/iwconfig wlan0 power off
if [ -e hostname.update ]
then
echo Hostname already set
else
rm set_hostname.sh* > /dev/null 2>&1
rm macadr-eth1.txt* > /dev/null 2>&1
wget -q https://raw.githubusercontent.com/smARTLab-liv/tbsetup/master/set_hostname.sh
wget -q https://raw.githubusercontent.com/smARTLab-liv/tbsetup/master/macadr-eth1.txt
chmod +x set_hostname.sh
./set_hostname.sh
do_reboot=1
fi
if [ -e hostnames1.update ]
then
echo Hostname file already updated
else
rm hosts* > /dev/null 2>&1
wget -q https://raw.githubusercontent.com/smARTLab-liv/tbsetup/master/hosts
hostname=$(cat /etc/hostname)
cat hosts | sed s/"HOSTNAME"/"$hostname"/ > /tmp/newhosts
mv /tmp/newhosts /etc/hosts
touch hostnames1.update
fi
if [ -e minimal_launch.update ]
then
echo Minimal launch updated
else
rm minimal.launch* > /dev/null 2>&1
wget -q https://raw.githubusercontent.com/smARTLab-liv/smartlab_turtlebot_launchers/master/launch/minimal.launch
mv minimal.launch /etc/ros/indigo/turtlebot_bringup.d/
touch minimal_launch.update
fi
if [ -e bash_rc.update ]
then
echo bash-rc updated
else
rm ../.bashrc* > /dev/null 2>&1
wget -q https://raw.githubusercontent.com/smARTLab-liv/tbsetup/master/.bashrc
mv .bashrc ../
touch bash-rc.update
fi
if [ -e master_sync.update ]
then
echo master_sync.update already set
else
apt-get update
apt-get install -y ros-indigo-master-sync-fkie
touch master_sync.update
fi
if [ -e libsvm.update ]
then
echo libsvm.update already set
else
apt-get update
apt-get install -y libsvm-dev
touch libsvm.update
fi
if [ -e people.update ]
then
echo people.update already set
else
apt-get update
apt-get install -y ros-indigo-people
touch people.update
fi
if [ -e env.update ]
then
echo env already installed already set
else
echo export TURTLEBOT_3D_SENSOR=kinect >> /etc/environment
echo export TURTLEBOT_BATTERY=/sys/class/power_supply/BAT1 >> /etc/environment
touch env.update
do_reboot=1
fi
if [ -e dist_upgrade.update ]
then
echo env already installed already set
else
grub-install /dev/sda
apt-get update
apt-get install tmux distcc -y
unset UCF_FORCE_CONFFOLD
export UCF_FORCE_CONFFNEW=YES
ucf --purge /boot/grub/menu.lst
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -o Dpkg::Options::="--force-confdef" --force-yes -fuy dist-upgrade
touch dist_upgrade.update
do_reboot=1
fi
if [ "$do_reboot" -eq 1 ]
then
reboot
fi
## time update
/usr/sbin/ntpdate ntp.ubuntu.com
### OLD
# if [ -e locale.update ]
# then
# echo locale already installed already set
# else
# echo LC_ALL="en_GB.utf8" >> /etc/environment
# touch locale.update
# fi
##all the rest will be done as user turtlebot
sudo -H -u turtlebot /bin/bash - << eof
if [ -x /home/turtlebot/smartlab_dotfiles ]
then
echo already checked out smartlab_dotfiles
cd /home/turtlebot/smartlab_dotfiles
git pull
else
cd /home/turtlebot/
git clone [email protected]:smARTLab-liv/smartlab_dotfiles.git
fi
if [ -x /home/turtlebot/ros/src/spencer_people_tracking ]
then
echo already checked out spencer tracking code
else
cd /home/turtlebot/ros/src
git clone https://github.com/spencer-project/spencer_people_tracking.git
fi
if [ -x /home/turtlebot/ros/src/collvoid ]
then
echo already checked out
cd /home/turtlebot/ros/src/collvoid
git pull
git checkout highly_experimental
else
cd /home/turtlebot/ros/src
git clone https://github.com/daenny/collvoid.git -b highly_experimental
fi
if [ -x /home/turtlebot/ros/src/swarming_turtles ]
then
cd /home/turtlebot/ros/src/swarming_turtles
git pull
fi
eof
# source /opt/ros/indigo/setup.bash
# source /home/turtlebot/ros/devel/setup.bash
# export ROS_WORKSPACE=/home/turtlebot/ros
# export ROS_PACKAGE_PATH=$ROS_WORKSPACE:$ROS_PACKAGE_PATH
# cd /home/turtlebot/ros
# echo making catkin
# catkin_make