#!/bin/bash getJSON (){ echo "\"$1\" : \"$2\"," } getBooleanJSON (){ echo "\"$1\" : $2," } # Remove OLD Server if available if [[ -d "master_server" ]]; then rm -rf master_server fi; # Getting server from github git clone https://github.com/project-ncloud/master_server.git # Goto the work dir cd master_server # Creating Virtual environment if [[ "$OSTYPE" == "msys" ]]; then python -m venv venv else python3 -m venv venv fi; # Activating Venv for installing dependencies . venv/*/activate # Installing Dependencies pip3 install -r requirements.txt # Deactivate the env and exit deactivate # Genarating KEY For master KEY=$(openssl rand -base64 32) echo "Enter DATABASE NAME: " read DB_NAME echo "Enter ADMIN KEY: " read ADMIN_KEY if [[ "$OSTYPE" == "msys" ]]; then HOSTNAME="127.0.0.1" else HOSTNAME=$(hostname -I | cut -d' ' -f1) fi; # Genarating environment file for master cat > .env <> secret.keys echo "Your KEY is saved into ${pwd}/secret.keys"