Skip to content

Commit

Permalink
set up failover only in pro
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Nov 6, 2024
1 parent 20fd996 commit c11629b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/nm-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ configure_netclient() {
nmctl host update $HOST_ID --default
sleep 5
nmctl node create_remote_access_gateway netmaker $NODE_ID
#setup failOver
sleep 5
curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/v1/node/${NODE_ID}/failover" --header "Authorization: Bearer ${MASTER_KEY}"

sleep 2
# create network for internet access vpn
if [ "$INSTALL_TYPE" = "pro" ]; then
#setup failOver
curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/v1/node/${NODE_ID}/failover" --header "Authorization: Bearer ${MASTER_KEY}"
INET_NODE_ID=$(sudo cat /etc/netclient/nodes.json | jq -r '."internet-access-vpn".id')
nmctl node create_remote_access_gateway internet-access-vpn $INET_NODE_ID
out=$(nmctl node list -o json | jq -r '.[] | select(.id=='\"$INET_NODE_ID\"') | .ingressdns = "8.8.8.8"')
Expand All @@ -181,7 +181,6 @@ configure_netclient() {
curl --location --request PUT "https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/internet-access-vpn/${INET_NODE_ID}" --data "$out" --header "Authorization: Bearer ${MASTER_KEY}"
curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/internet-access-vpn/${INET_NODE_ID}/inet_gw" --data '{}' --header "Authorization: Bearer ${MASTER_KEY}"
fi

set -e
}

Expand Down

0 comments on commit c11629b

Please sign in to comment.