#!/bin/bash
# Auther: Yongqian.zhao
# Date & Time: 2020.09.07
# Description: Sync user scripts
# Entry function
function main() {
echo "Do sync data start"
if [ -z "$1" ]
then
echo "host must is not null!"
exit
fi
if [ -z "$2" ]
then
echo "File path must is not null!"
exit
fi
curl -H "Content-Type: application/x-ndjson" -XPOST $1:9200/usr_user/user/_bulk?pretty --data-binary "@$2/users.json";
echo "Do sync data end"
}
# Script entry
main $1 $2