6
6
# *****************************COPYRIGHT*******************************
7
7
8
8
# This script will ask for kgo update information then moves the directory kgo_update
9
- # to ~frum . It then calls `run_kgo_script.sh` as frum which itself calls the update
9
+ # to ~${root_user} . It then calls `run_kgo_script.sh` as ${root_user} which itself calls the update
10
10
# script. It then moves the generated variables files back into the working copy.
11
11
# The kgo_update.py script can be run with the --new-release option by providing
12
12
# 'new-release' as a command line option to this script
@@ -21,14 +21,18 @@ script_loc="$(dirname "$0")"
21
21
22
22
# Work out if we're running from azspice or old spice
23
23
if [[ $HOSTNAME == " caz" * ]]; then
24
+ root_user=" umadmin"
25
+ root_home=" /home/users/umadmin"
24
26
launch_platform=azspice
25
27
# Check you can sudo in as umadmin
26
- sudo -iu umadmin bash -c " echo ''"
28
+ sudo -iu ${root_user} bash -c " echo ''"
27
29
if [[ $? -ne 0 ]]; then
28
30
printf " ${RED} You were unable to run commands as umadmin - this is required to run this script"
29
31
printf " This may be because of a password typo or similar"
30
32
fi
31
33
else
34
+ root_user=" frum"
35
+ root_home=" /home/h01/frum"
32
36
launch_platform=spice
33
37
fi
34
38
125
129
126
130
# Move the kgo_update directory to frum on linux
127
131
if [[ $launch_platform == " spice" ]]; then
128
- scp -rq $script_loc /kgo_update frum @localhost:~
132
+ scp -rq $script_loc /kgo_update ${root_user} @localhost:~
129
133
else
130
- sudo -iu umadmin bash -c " cp -r $script_loc /kgo_update /home/users/umadmin "
134
+ sudo -iu ${root_user} bash -c " cp -r $script_loc /kgo_update ${root_home} "
131
135
fi
132
136
133
137
# Define command to run as frum
@@ -142,11 +146,11 @@ command=". /etc/profile ; module load scitools ; cd kgo_update ;
142
146
-V ${version_number} ;
143
147
cd ~ ; rm -rf kgo_update"
144
148
145
- # Run the command as frum
149
+ Run the command as frum
146
150
if [[ $launch_platform == " spice" ]]; then
147
- ssh -Y frum @localhost $command
151
+ ssh -Y ${root_user} @localhost $command
148
152
else
149
- sudo -iu umadmin bash -c " cd $UMDIR ; $command "
153
+ sudo -iu ${root_user} bash -c " cd $UMDIR ; $command "
150
154
fi
151
155
152
156
# Error Checking and rsyncing
@@ -157,12 +161,12 @@ succeeded_xc40=0
157
161
succeeded_ex1a=0
158
162
succeeded_all=1
159
163
if [[ $platforms == * " spice" * ]] && [[ $platforms != * " azspice" * ]]; then
160
- file=~ frum /${variables_dir} /spice_update_script.sh
164
+ file=${root_home} /${variables_dir} /spice_update_script.sh
161
165
if [[ -e " $file " ]]; then
162
166
succeeded_spice=1
163
167
if [[ $new_release -ne 1 ]]; then
164
168
printf " ${GREEN} \n\nCopying the spice variables file into this working copy.\n${NC} "
165
- scp -q frum @localhost:~ /${variables_dir} /spice_updated_variables${variables_extension} \
169
+ scp -q ${root_user} @localhost:~ /${variables_dir} /spice_updated_variables${variables_extension} \
166
170
${wc_path} /rose-stem/site/meto/variables_spice${variables_extension}
167
171
if [[ $? -ne 0 ]]; then
168
172
printf " ${RED} The copy of the spice variables file into this working copy has failed.\n${NC} "
@@ -175,12 +179,12 @@ if [[ $platforms == *"spice"* ]] && [[ $platforms != *"azspice"* ]]; then
175
179
fi
176
180
fi
177
181
if [[ $platforms == * " azspice" * ]]; then
178
- file=~ umadmin /${variables_dir} /azspice_update_script.sh
182
+ file=${root_home} /${variables_dir} /azspice_update_script.sh
179
183
if [[ -e " $file " ]]; then
180
184
succeeded_azspice=1
181
185
if [[ $new_release -ne 1 ]]; then
182
186
printf " ${GREEN} \n\nCopying the azspice variables file into this working copy.\n${NC} "
183
- cp /home/users/umadmin /${variables_dir} /azspice_updated_variables${variables_extension} \
187
+ cp ${root_home} /${variables_dir} /azspice_updated_variables${variables_extension} \
184
188
${wc_path} /rose-stem/site/meto/variables_azspice${variables_extension}
185
189
if [[ $? -ne 0 ]]; then
186
190
printf " ${RED} The copy of the azspice variables file into this working copy has failed.\n${NC} "
@@ -189,20 +193,21 @@ if [[ $platforms == *"azspice"* ]]; then
189
193
fi
190
194
fi
191
195
else
196
+ echo $file
192
197
succeeded_all=0
193
198
fi
194
199
fi
195
200
if [[ $platforms == * " xc40" * ]]; then
196
- file=~ frum /${variables_dir} /xc40_update_script.sh
201
+ file=${root_home} /${variables_dir} /xc40_update_script.sh
197
202
if [[ -e " $file " ]]; then
198
203
succeeded_xc40=1
199
204
if [[ $new_release -ne 1 ]]; then
200
205
printf " ${GREEN} \n\nCopying the xc40 variables file into this working copy.\n${NC} "
201
206
if [[ $launch_platform == " spice" ]]; then
202
- scp -q frum @localhost:~ /${variables_dir} /xc40_updated_variables${variables_extension} \
207
+ scp -q ${root_user} @localhost:~ /${variables_dir} /xc40_updated_variables${variables_extension} \
203
208
${wc_path} /rose-stem/site/meto/variables_xc40${variables_extension}
204
209
else
205
- cp /home/users/umadmin /${variables_dir} /xc40_updated_variables${variables_extension} \
210
+ cp ${root_home} /${variables_dir} /xc40_updated_variables${variables_extension} \
206
211
${wc_path} /rose-stem/site/meto/variables_xc40${variables_extension}
207
212
fi
208
213
if [[ $? -ne 0 ]]; then
@@ -216,16 +221,16 @@ if [[ $platforms == *"xc40"* ]]; then
216
221
fi
217
222
fi
218
223
if [[ $platforms == * " ex1a" * ]]; then
219
- file=~ frum /${variables_dir} /ex1a_update_script.sh
224
+ file=${root_home} /${variables_dir} /ex1a_update_script.sh
220
225
if [[ -e " $file " ]]; then
221
226
succeeded_ex1a=1
222
227
if [[ $new_release -ne 1 ]]; then
223
228
printf " ${GREEN} \n\nCopying the ex1a variables file into this working copy.\n${NC} "
224
229
if [[ $launch_platform == " spice" ]]; then
225
- scp -q frum @localhost:~ /${variables_dir} /ex1a_updated_variables${variables_extension} \
230
+ scp -q ${root_user} @localhost:~ /${variables_dir} /ex1a_updated_variables${variables_extension} \
226
231
${wc_path} /rose-stem/site/meto/variables_ex1a${variables_extension}
227
232
else
228
- cp /home/users/umadmin /${variables_dir} /ex1a_updated_variables${variables_extension} \
233
+ cp ${root_home} /${variables_dir} /ex1a_updated_variables${variables_extension} \
229
234
${wc_path} /rose-stem/site/meto/variables_ex1a${variables_extension}
230
235
fi
231
236
if [[ $? -ne 0 ]]; then
@@ -260,9 +265,9 @@ if [[ $succeeded_xc40 -eq 1 ]]; then
260
265
host_rsync=$( rose host-select xc)
261
266
rsync_com=" ssh -Y ${host_rsync} 'rsync -av /projects/um1/standard_jobs/${rsync_dir} xcslr0:/common/um1/standard_jobs/${rsync_dir} '"
262
267
if [[ $launch_platform == " spice" ]]; then
263
- ssh -Y frum @localhost $rsync_com
268
+ ssh -Y ${root_user} @localhost $rsync_com
264
269
else
265
- sudo -iu umadmin bash -c ' $rsync_com'
270
+ sudo -iu ${root_user} bash -c ' $rsync_com'
266
271
fi
267
272
if [[ $? -ne 0 ]]; then
268
273
printf " ${RED} The rsync to the xcs has failed.\n${NC} "
@@ -285,9 +290,9 @@ if [[ $succeeded_ex1a -eq 1 ]]; then
285
290
# rsync to EXZ
286
291
rsync_com=" ssh -Y ${host_rsync} 'rsync -av /common/internal/umdir/standard_jobs/${rsync_dir} login.exz:/common/umdir/standard_jobs/${rsync_dir} '"
287
292
if [[ $launch_platform == " spice" ]]; then
288
- ssh -Y frum @localhost $rsync_com
293
+ ssh -Y ${root_user} @localhost $rsync_com
289
294
else
290
- sudo -iu umadmin bash -c ' $rsync_com'
295
+ sudo -iu ${root_user} bash -c ' $rsync_com'
291
296
fi
292
297
if [[ $? -ne 0 ]]; then
293
298
printf " ${RED} The rsync to the exz has failed.\n${NC} "
@@ -299,17 +304,17 @@ if [[ $succeeded_ex1a -eq 1 ]]; then
299
304
excd_host=$( rose host-select excd)
300
305
rsync_com=" ssh -Y ${host_rsync} 'rsync -av /common/internal/umdir/standard_jobs/${rsync_dir} ${excd_host} :/common/internal/umdir/standard_jobs/${rsync_dir} '"
301
306
if [[ $launch_platform == " spice" ]]; then
302
- ssh -Y frum @localhost $rsync_com
307
+ ssh -Y ${root_user} @localhost $rsync_com
303
308
else
304
- sudo -iu umadmin bash -c ' $rsync_com'
309
+ sudo -iu ${root_user} bash -c ' $rsync_com'
305
310
fi
306
311
if [[ $? -ne 0 ]]; then
307
312
printf " ${RED} The rsync to the excd has failed.\n${NC} "
308
313
else
309
314
printf " ${Green} The rsync to the excd has succeeded.\n${NC} "
310
315
fi
311
316
elif [[ $platforms == * " ex1a" * ]]; then
312
- printf " ${RED} \n\nSkipping the rsync to the exa as the exz install failed.\n${NC} "
317
+ printf " ${RED} \n\nSkipping the rsync to the exz/cd as the exab install failed.\n${NC} "
313
318
fi
314
319
315
320
printf " \n\nInstallation Summary:\n\n"
0 commit comments