From 5ea30d7f13b367d12ad8cdcd4a6ef4f55e5d7167 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 9 May 2018 11:18:43 -0400 Subject: [PATCH] JBAS-1998 Sftp client process selected district code Fixes a bug where selecting a specific district code using -d would process the selected code plus all college codes. Signed-off-by: Bill Erickson --- KCLS/utility-scripts/import_students/sftp-client-agent.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/KCLS/utility-scripts/import_students/sftp-client-agent.sh b/KCLS/utility-scripts/import_students/sftp-client-agent.sh index f5930d9bb9..04d649756e 100755 --- a/KCLS/utility-scripts/import_students/sftp-client-agent.sh +++ b/KCLS/utility-scripts/import_students/sftp-client-agent.sh @@ -49,6 +49,9 @@ COLLEGE_CODES=( "lwt" # Lake Washington Institute of Technology ); +# Which codes to process in this iteration of the script. +CODES_TO_PROCESS=(); + # Hard-code the districts eligible for automatic teacher account processing. # College teacher accounts are processed the same as school teacher accounts. TEACHER_DISTRICTS=( @@ -150,7 +153,9 @@ SERVER_AGENT="/home/$USER/sftp-server-agent.sh" # only process the requested district if specified if [ -n "$DISTRICT_CODE" ]; then - DISTRICT_CODES=($DISTRICT_CODE); + CODES_TO_PROCESS=($DISTRICT_CODE); +else + CODES_TO_PROCESS=("${DISTRICT_CODES[@]}" "${COLLEGE_CODES[@]}"); fi; announce "Connecting to server $SERVER" @@ -158,7 +163,7 @@ if [ -n "$PROCESS_FILES" ]; then announce "Processing files on DB $DB_HOST" fi -for code in "${DISTRICT_CODES[@]}" "${COLLEGE_CODES[@]}"; do +for code in "${CODES_TO_PROCESS[@]}"; do COMMAND="$SERVER_AGENT -d $code"; COMPLETE_DIR="/home/sftp$code/complete" -- 2.11.0