This commit is contained in:
Venkatesh Babu
2024-04-17 08:02:53 +05:30
parent 5d8c32ce47
commit 834f59ad1f
2 changed files with 7 additions and 25 deletions

View File

@@ -166,34 +166,17 @@ read -p "Enter your choice: " choice
boldGreen="\e[1m\e[92m"
reset="\e[0m"
# Function to request network configuration URL
requestNetworkConfig() {
echo "Please provide the network-specific configuration URL."
read -p "Paste the URL of the network configuration here (or press Enter to skip): " config_url
if [ -n "$config_url" ]; then
echo "Network configuration URL provided: $config_url"
else
echo "No network configuration URL provided, proceeding without it."
fi
echo ""
}
# Function to handle the setup process for each platform
completeSetup() {
platform=$1
config_url=$2 # Passing this as an argument, though it could be optional or ignored by some setups
public_address="https://<your public IP address>"
echo "Proceeding with the setup for $platform..."
if [ -n "$config_url" ]; then
echo "Using network configuration from: $config_url"
fi
# Insert the specific commands for each platform, including requesting network config if necessary
case $platform in
"Registry")
requestNetworkConfig
read -p "Enter publicly accessible registry URL: " registry_url
if [[ $registry_url =~ /$ ]]; then
new_registry_url=${registry_url%/}
@@ -205,7 +188,6 @@ completeSetup() {
install_registry $new_registry_url
;;
"Gateway"|"Beckn Gateway")
requestNetworkConfig
read -p "Enter your registry URL: " registry_url
read -p "Enter publicly accessible gateway URL: " gateway_url
@@ -223,7 +205,6 @@ completeSetup() {
install_gateway $new_registry_url $gateway_url
;;
"BAP")
requestNetworkConfig
echo "${GREEN}................Installing Protocol Server for BAP................${NC}"
read -p "Enter BAP Subscriber ID: " bap_subscriber_id
@@ -235,7 +216,6 @@ completeSetup() {
install_bap_protocol_server $registry_url $bap_subscriber_id $bap_subscriber_key_id $bap_subscriber_url
;;
"BPP")
requestNetworkConfig
echo "${GREEN}................Installing Protocol Server for BAP................${NC}"
read -p "Enter BPP Subscriber ID: " bpp_subscriber_id
read -p "Enter BPP Subscriber URL: " bpp_subscriber_url
@@ -274,8 +254,7 @@ read -p "Enter your choice: " platform_choice
selected_platform="${platforms[$((platform_choice-1))]}"
if [[ -n $selected_platform ]]; then
# Note: Passing an empty string for config_url since it's optionally handled within `completeSetup`
completeSetup "$selected_platform" ""
completeSetup "$selected_platform"
else
echo "Invalid option. Please restart the script and select a valid option."
exit 1