You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REM Show the command only if requested, masking passwords
162
+
echo Running pre-check ...
163
+
REM Check if we can connect with provided information
164
+
%CHECK_CONNECTION_CMD%>nul2>nul
165
+
iferrorlevel1 (
166
+
echo Error: Unable to connect to HANA instance %DB_HOST% as user %DB_USER% with the provided password ^(hdbsql exit code 3 - authentication error^) >&2
167
+
exit /b 3
168
+
)
169
+
echo Connection to HANA instance %DB_HOST% as user %DB_USER% successful.
170
+
171
+
REM Run the pre-check SQL (check_create_CHECK_APL_user.sql) using the exact same hdb parameters.
172
+
REM This script contains pre-checks that must pass before running check_apl.sql.
173
+
174
+
REM Create temporary file for pre-check output
175
+
set"PREOUT=%TEMP%\precheck_%RANDOM%.tmp"
176
+
%PRECHECK_CMD%2>"%PREOUT%"
177
+
178
+
REM Fatal: check for specific error codes in output
179
+
findstr /C:"10001""%PREOUT%">nul
180
+
ifnoterrorlevel1 (
181
+
echo Fatal Error: pre-check detected %DB_USER% user does not have 'USER ADMIN' privilege >&2
182
+
del /f "%PREOUT%"2>nul
183
+
exit /b 10001
184
+
)
185
+
186
+
findstr /C:"10002""%PREOUT%">nul
187
+
ifnoterrorlevel1 (
188
+
echo Fatal Error: pre-check detected provided password for temporary CHECK_APL user does not match current password policy >&2
189
+
del /f "%PREOUT%"2>nul
190
+
exit /b 10002
191
+
)
192
+
193
+
REM Pre-check passed (no fatal errors)
194
+
del /f "%PREOUT%"2>nul
195
+
echo Pre-check completed successfully. Actual check can be done
196
+
150
197
if"%SHOW_CMD_ONLY%"=="1" (
198
+
REM Mask passwords in the displayed command and remove double quotes for an unquoted view
# Check if we can connect with provided informations
211
+
set +e
212
+
eval$CHECK_CONNECTION_CMD> /dev/null 2>&1
213
+
if [[ $?-ne 0 ]];then
214
+
echo"Error: Unable to connect to HANA instance $DB_HOST as user $HANA_SYSTEM_USER with the provided password (hdbsql exit code 3 - authentication error)">&2
215
+
exit 3
216
+
fi
217
+
echo"Connection to HANA instance $DB_HOST as user $HANA_SYSTEM_USER successful."
218
+
219
+
# Run the pre-check SQL (check_create_CHECK_APL_user.sql) using the exact same hdb parameters.
220
+
# This script contains pre-checks that must pass before running check_apl.sql.
221
+
222
+
set -e
223
+
PREOUT="$(mktemp)"
224
+
eval$PRECHECK_CMD2>"$PREOUT"
225
+
# Fatal: check for specific error codes in output
226
+
if grep -q '10001'"$PREOUT";then
227
+
echo"Fatal Error: pre-check detected $HANA_SYSTEM_USER user does not have 'USER ADMIN' privilege">&2
228
+
rm -f "$PREOUT"
229
+
exit 10001
230
+
fi
231
+
if grep -q '10002'"$PREOUT";then
232
+
echo"Fatal Error: pre-check detected provided password for temporary CHECK_APL user does not match current password policy">&2
233
+
rm -f "$PREOUT"
234
+
exit 10002
235
+
fi
236
+
# Pre-check passed (no fatal errors)
237
+
rm -f "$PREOUT"
238
+
echo"Pre-check completed successfully. Actual check can be done"
239
+
240
+
if [[ "${SHOW_CMD_ONLY:-0}"-eq 1 ]];then
241
+
# Mask passwords in the displayed command and remove double quotes for an unquoted view
0 commit comments