Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions script/oracle/install-instantclient-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
set +o pipefail

# Execute this script by a user with read right ability to /opt/oracle and /opt/system/vendor/oracle
declare oracle_otn=https://download.oracle.com/otn_software/linux/instantclient/1918000
declare oracle_version=linux.x64-19.18.0.0.0dbru
declare oracle_otn=https://download.oracle.com/otn_software/linux/instantclient/1931000v2
declare oracle_version=linux.x64-19.31.0.0.0dbru
declare -a packages=(instantclient-sdk instantclient-odbc)

function install_pkg {
local package="$1"
local path="vendor/oracle"
local zip="${package}-${oracle_version}.zip"
local file="vendor/oracle/${zip}"
local file="$path/${zip}"
local existing_file="$path/${package}-"*".zip"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brace expansions and globs are literal in assignments. Quote it or use an array. [shellcheck:2125]


if [ -f "${file}" ]; then
echo "[OK] ${file} already present"
if [ -f "${existing_file}" ]; then
echo "[OK] ${existing_file} already present"
file="${existing_file}"
else
echo "[INFO] Downloading ${zip} from Oracle servers"
wget "${oracle_otn}/${zip}" -O "${file}"
Expand Down Expand Up @@ -42,6 +45,6 @@ fi

# hack for system-builder ENV
rm -rf /opt/system/vendor/oracle
ln -sf /opt/oracle/instantclient_19_18/libsqora.so.19.1 /opt/oracle/instantclient_19_18/libsqora.so
ln -sf /opt/oracle/instantclient_19_18 /opt/oracle/instantclient
ln -sf /opt/oracle/instantclient_19_31/libsqora.so.19.1 /opt/oracle/instantclient_19_31/libsqora.so
ln -sf /opt/oracle/instantclient_19_31 /opt/oracle/instantclient
cp config/oracle/*.ini /etc/