Updates docs for SR1 with final revision
[genesis.git] / fuel / prototypes / auto-deploy / deploy / tools / transplant0.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 cleanup () {
13     if [ -n "$tmpDir" ]; then
14         rm -Rf $tmpDir
15     fi
16 }
17
18 trap cleanup exit
19
20 error_exit () {
21     echo "Error: $@" >&2
22     exit 1
23 }
24
25 tmpDir=`mktemp -d /tmp/deaXXXX`
26
27 export PATH=`dirname $0`:$PATH
28
29 if [ $# -lt 1 ]; then
30     error_exit "Argument error"
31 fi
32 deafile=$1
33 shift
34
35 if [ ! -f "$deafile" ]; then
36     error_exit "Can't find $deafile"
37 fi
38
39 transplant_fuel_settings.py /etc/fuel/astute.yaml $deafile || \
40     error_exit "Could not transplant astute settings"