Skip to content
Merged
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
19 changes: 11 additions & 8 deletions cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc_ini.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand All @@ -19,25 +19,28 @@

# GH-47876 TODO: create macOS ODBC Installer.
# Script for installing macOS ODBC driver, to be used for macOS installer.
# This script assumes ODBC driver is at
# /Library/ODBC/arrow-odbc/libarrow_flight_sql_odbc.dylib

set -euo pipefail

if [ $EUID -ne 0 ]; then
echo "Please run this script with sudo"
exit 1
fi

source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

odbc_install_script="${source_dir}/install_odbc.sh"

chmod +x "$odbc_install_script"
. "$odbc_install_script" /Library/Apache/ArrowFlightSQLODBC/lib/libarrow_flight_sql_odbc.dylib
"$odbc_install_script" /Library/ODBC/arrow-odbc/libarrow_flight_sql_odbc.dylib

USER_ODBC_FILE="$HOME/Library/ODBC/odbc.ini"
DRIVER_NAME="Apache Arrow Flight SQL ODBC Driver"
DSN_NAME="Apache Arrow Flight SQL ODBC DSN"

touch "$USER_ODBC_FILE"

if [ $EUID -ne 0 ]; then
echo "Please run this script with sudo"
exit 1
fi

if grep -q "^\[$DSN_NAME\]" "$USER_ODBC_FILE"; then
echo "DSN [$DSN_NAME] already exists in $USER_ODBC_FILE"
else
Expand Down
Loading