#!/bin/sh

#
# Script used for syncing APS user accounts

# Usage:
#
#   $0 
#

CURRENT_DIR=`pwd`
MY_DIR=`dirname $0` && cd $MY_DIR && MY_DIR=`pwd`
cd $CURRENT_DIR
DM_ROOT_DIR=$MY_DIR/..
DM_ENV_FILE=${DM_ROOT_DIR}/setup.sh
if [ ! -f ${DM_ENV_FILE} ]; then
    echo "Environment file ${DM_ENV_FILE} does not exist." 
    exit 2
fi
. ${DM_ENV_FILE} > /dev/null 
DM_CONFIG_FILE=$DM_ROOT_DIR/../etc/dm.aps-user-update-utilities.conf

# Simply run update command after sourcing setup file
dm-update-users-from-aps-db --config-file=$DM_CONFIG_FILE --quiet

