Browse Source

upgrade flag

abhishek9686 1 year ago
parent
commit
abe7f4cf52
1 changed files with 5 additions and 4 deletions
  1. 5 4
      scripts/nm-quick.sh

+ 5 - 4
scripts/nm-quick.sh

@@ -18,6 +18,7 @@ unset IMAGE_TAG
 unset AUTO_BUILD
 unset AUTO_BUILD
 unset NETMAKER_BASE_DOMAIN
 unset NETMAKER_BASE_DOMAIN
 INSTALL_TYPE="pro"
 INSTALL_TYPE="pro"
+UPGRADE_FLAG="yes"
 # usage - displays usage instructions
 # usage - displays usage instructions
 usage() {
 usage() {
 	echo "nm-quick.sh v$NM_QUICK_VERSION"
 	echo "nm-quick.sh v$NM_QUICK_VERSION"
@@ -31,6 +32,7 @@ while getopts evab:d:t: flag; do
 	case "${flag}" in
 	case "${flag}" in
 	c)
 	c)
 		INSTALL_TYPE="ce"
 		INSTALL_TYPE="ce"
+		UPGRADE_FLAG="no"
 		;;
 		;;
 	v)
 	v)
 		usage
 		usage
@@ -129,7 +131,9 @@ install_yq() {
 setup_netclient() {
 setup_netclient() {
 
 
 	set +e
 	set +e
-	netclient uninstall
+	if [ -x "$(command -v netclient)" ]; then
+		netclient uninstall
+	fi
 	set -e
 	set -e
 
 
 	wget -qO netclient https://github.com/gravitl/netclient/releases/download/$LATEST/netclient-linux-$ARCH
 	wget -qO netclient https://github.com/gravitl/netclient/releases/download/$LATEST/netclient-linux-$ARCH
@@ -739,9 +743,6 @@ print_logo
 if [ -f "$CONFIG_PATH" ]; then
 if [ -f "$CONFIG_PATH" ]; then
 	echo "Using config: $CONFIG_PATH"
 	echo "Using config: $CONFIG_PATH"
 	source "$CONFIG_PATH"
 	source "$CONFIG_PATH"
-	if [ "$UPGRADE_FLAG" = "yes" ]; then
-		INSTALL_TYPE="pro"
-	fi
 fi
 fi
 
 
 # 2. setup the build instructions
 # 2. setup the build instructions