allow dashes and underscores, fixed incorrect command in guide

This commit is contained in:
Menno van Leeuwen 2024-11-02 18:51:04 +01:00
parent 11fd6bc478
commit 946ae2b987
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ Either install GNOME or Minimal depending on if you intend to setup a server or
Clone the repository to your home directory, you can do this by opening a shell with git installed.
```bash
nixos-shell -p git
nix-shell -p git
git clone https://git.mvl.sh/vleeuwenmenno/dotfiles.git ~/dotfiles
exit
```

View File

@ -45,7 +45,7 @@ prepare_hostname() {
read hostname
# Validate hostname to ensure it's not empty, contains only alphanumeric characters, and is less than 64 characters
while [[ -z $hostname || ! $hostname =~ ^[a-zA-Z0-9]+$ || ${#hostname} -gt 64 ]]; do
while [[ -z $hostname || ! $hostname =~ ^[a-zA-Z0-9_-]+$ || ${#hostname} -gt 64 ]]; do
echo "Invalid hostname. Please enter a valid hostname:"
read hostname
done