Last active
April 11, 2019 01:36
-
-
Save mecab/d83ea8eb881e07786cb3fa9819db8a71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# PROJECT_FROM="firebase-project-from" | |
# PROJECT_TO="firebase-project-to" | |
function getParam() { | |
echo $(cat .hashParameter | grep ${1}: | sed 's/.*: \(.*\),/\1/') | |
} | |
cd $(dirname "$0") | |
if [ ! -f .hashParameter ]; then | |
echo 'Place .hashParameter in same directory as this script. Exiting.' | |
exit 1 | |
fi | |
algorithm=$(getParam algorithm) | |
base64_signer_key=$(getParam base64_signer_key) | |
base64_salt_separator=$(getParam base64_salt_separator) | |
rounds=$(getParam rounds) | |
mem_cost=$(getParam mem_cost) | |
echo "algorithm: ${algorithm}" | |
echo "base64_signer_key: ${base64_signer_key}" | |
echo "base64_salt_separator: ${base64_salt_separator}" | |
echo "rounds: ${rounds}" | |
echo "mem_cost: ${mem_cost}" | |
tmpfile="$(mktemp -u).json" | |
echo "tmpfile: ${tmpfile}" | |
firebase auth:export --project=${PROJECT_FROM} "${tmpfile}" | |
firebase auth:import \ | |
--project="${PROJECT_TO}" \ | |
--hash-algo="${algorithm}" \ | |
--salt-separator="${base64_salt_separator}" \ | |
--hash-key="${base64_salt_separator}" \ | |
--rounds="${rounds}" \ | |
--mem-cost="${mem_cost}" \ | |
"${tmpfile}" | |
rm -f "${tmpfile}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment