#!/bin/bash


script_path="Installable/scripts"
patch_path="Installable/installables/patch"
CSVFILE="Installable/installables/patch/patch.csv"

function install_patch ()
{

        if [[ -z $patch_zip ]]; then
                echo "Script must be run with zip file name as argument " 
                exit 1


        else

                unzip -o $patch_zip -d $patch_path
                sleep 1
                if [ ! -f $CSVFILE ]
                 then
                        echo "Zip filepath/filename is incorrect.."
                        exit 1
                else
                        cd $script_path
                        bash install.sh 2
                        echo "Installed patch version: " `cat /parablu/installed_version`
                 fi       
        fi

}

patch_zip=$1
install_patch

