Add bashate verification and fix shell errors
[icn.git] / tools / cloud-configs.sh
1 !/bin/bash
2
3 # This script is called by cloud-init on worker nodes
4 # What does this script do:
5 # 1. Copy qat driver tarball and sriov tarball from share folder
6 # 2. Extract the tarball and run install.sh to install the drivers
7
8 # Need a variable named $SHARE_FOLDER to indicate the share folder location
9
10 MODULES_LIST="qat_driver sriov_driver"
11 VER="0.1"
12 SHARE_FOLDER=${SHARE_FOLDER:-"package"}
13
14 for module in $MODULES_LIST; do
15     filename=$module-$VER.tar.gz
16     if [ ! -e $filename ]; then
17         if [ ! -e $SHARE_FOLDER/$filename ]; then
18         echo "Cannot install module $module ..."
19         continue
20     else
21             cp $SHARE_FOLDER/$filename .
22         fi
23     fi
24
25     tar xvzf $filename
26     if [ -d $module ]; then
27         echo "Installing module $module ..."
28     pushd $module
29         bash ./install.sh
30         popd
31     rm -rf $module
32     fi
33 done
34