diff --git a/costumize.sh b/costumize.sh index b33294a..ff269f9 100755 --- a/costumize.sh +++ b/costumize.sh @@ -37,20 +37,16 @@ check_user() { set_hostname() { echo "" echo -e "${BLUE}=== Server Hostname Configuration ===${NC}" - echo "Current hostname: $(hostname)" + local current_hostname=$(hostname) + echo "Current hostname: $current_hostname" echo "" - read -p "Do you want to change the hostname? (y/N): " change_hostname - - if [[ ! "$change_hostname" =~ ^[Yy]$ ]]; then - log "Keeping current hostname: $(hostname)" - return 0 - fi - - read -p "Enter new hostname for this server: " new_hostname + read -p "Enter hostname for this server (press Enter to keep '$current_hostname'): " new_hostname + # If empty, keep current hostname if [[ -z "$new_hostname" ]]; then - error "Hostname cannot be empty" + log "Keeping current hostname: $current_hostname" + return 0 fi # Validate hostname format