Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support setup shell for mac #177

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/p2p-tutorial/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ SCRIPT_DIR=$(
)

# generate password for mysql root user
MYSQL_PASSWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
grep -rl '__MYSQL_ROOT_PASSWD__' --exclude='*.sh' ${SCRIPT_DIR}/ | xargs sed -i "s/__MYSQL_ROOT_PASSWD__/${MYSQL_PASSWD}/g"
if [[ "$OSTYPE" == "darwin"* ]]; then
MYSQL_PASSWD=$(LC_CTYPE=C tr -dc A-Za-z0-9 </dev/urandom | head -c 13) # The locale needs to be specified on macos
grep -rl '__MYSQL_ROOT_PASSWD__' --exclude='*.sh' ${SCRIPT_DIR}/ | xargs sed -i "" "s/__MYSQL_ROOT_PASSWD__/${MYSQL_PASSWD}/g" # Should use sed -i "" on macos
else
MYSQL_PASSWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
grep -rl '__MYSQL_ROOT_PASSWD__' --exclude='*.sh' ${SCRIPT_DIR}/ | xargs sed -i "s/__MYSQL_ROOT_PASSWD__/${MYSQL_PASSWD}/g"
fi

# generate private pem for each party
PARTIES=("alice" "bob")
Expand Down
Loading