From c2977f499e645db7c5f05bcd6bd017d9d9b3c22a Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 13 Nov 2023 18:46:13 +0000 Subject: [PATCH] use debug env var instead --- .../scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh | 6 +++++- src/common/startup_scripts/vnc_startup.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh b/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh index 05c7811..1fa44f0 100644 --- a/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh +++ b/src/common/scripts/kasm_hook_scripts/kasm_pre_shutdown_user.sh @@ -62,7 +62,11 @@ if [ ! -z "$KASM_PROFILE_LDR" ]; then echo >&2 "Profile sync not available" else echo "Packing and uploading user profile to object storage." - http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + if [[ $DEBUG == true ]]; then + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + else + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --upload /home/kasm-user --insecure --filter "${KASM_PROFILE_FILTER}" --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} + fi echo "Profile upload complete." fi fi diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index a6744ac..df5e763 100755 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -70,7 +70,11 @@ function pull_profile (){ echo "Downloading and unpacking user profile from object storage." set +e - http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + if [[ $DEBUG == true ]]; then + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} --verbose + else + http_proxy="" https_proxy="" /usr/bin/kasm-profile-sync --download /home/kasm-user --insecure --remote ${KASM_API_HOST} --port ${KASM_API_PORT} -c ${KASM_PROFILE_CHUNK_SIZE} --token ${KASM_API_JWT} + fi PROCESS_SYNC_EXIT_CODE=$? set -e if (( PROCESS_SYNC_EXIT_CODE > 1 )); then