22 lines
572 B
Bash
22 lines
572 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
|
||
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||
|
|
source $SCRIPT_DIR/constants.sh
|
||
|
|
source $SCRIPT_DIR/functions.sh
|
||
|
|
|
||
|
|
# Setup logging
|
||
|
|
setup_logging
|
||
|
|
|
||
|
|
# Trap signals to ensure proper cleanup
|
||
|
|
trap 'cleanup 1' HUP INT QUIT TERM
|
||
|
|
|
||
|
|
path=$EVO_GROUPS_PATH/$EVO_API_STORE_ID
|
||
|
|
printf -v fileName "$EVO_RESPONSE_FILE_NAME_FORMAT.$EVO_RESPONSE_FILE_NAME_EXT" -1
|
||
|
|
mkdir -p $path
|
||
|
|
|
||
|
|
# Handle request for groups
|
||
|
|
handle_request "groups" "$EVO_API_GET_GROUPS" "$path" "$fileName"
|
||
|
|
|
||
|
|
# Use the cleanup function instead of directly exiting
|
||
|
|
cleanup 0
|