Skip to content

Commit

Permalink
command func
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Dec 3, 2023
1 parent df6fbd4 commit dd3009e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions install.ztnet/bash/ztnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ NC=$(tput sgr0) # No Color
# Detect local IP address
local_ip=$(hostname -I | awk '{print $1}')

# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}

ARCH="$(uname -m)"
case "$ARCH" in
"x86_64")
Expand Down Expand Up @@ -64,7 +69,7 @@ printf "Press space to proceed with the installation..." >&2
read -n1 -s < /dev/tty

# Inform the user about the default IP and ask if they want to change it
printf "The default IP address is ${YELLOW}$local_ip${NC}. Press Enter to use it, or type a new IP address and then press Enter.\n"
printf "\nThe default IP address is ${YELLOW}$local_ip${NC}. Press Enter to use it, or type a new IP address and then press Enter.\n"

# Read the user input
read -r input_ip
Expand Down Expand Up @@ -95,10 +100,6 @@ if ! command_exists psql; then
fi
fi

# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}

# update apt
sudo apt update
Expand Down

0 comments on commit dd3009e

Please sign in to comment.