Browse Source

check if netclient exists

abhishek9686 1 year ago
parent
commit
96c6495585
1 changed files with 3 additions and 0 deletions
  1. 3 0
      scripts/nm-quick.sh

+ 3 - 0
scripts/nm-quick.sh

@@ -665,6 +665,9 @@ print_success() {
 
 cleanup() {
 	# remove the existing netclient's instance from the existing network
+	if ! command -v netclient >/dev/null 2>&1; then
+		return
+	fi
 	if command -v nmctl >/dev/null 2>&1; then
 		local node_id=$(netclient list | jq '.[0].node_id' 2>/dev/null)
 		# trim doublequotes