hostname automation

This commit is contained in:
2026-04-11 00:55:20 -07:00
parent dc42abeaa2
commit 275f41caa7
2 changed files with 17 additions and 0 deletions

7
aptprimary.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Need armbian-config?
apt install -y vim git
apt install -y docker.io docker-cli docker-compose

View File

@@ -33,3 +33,13 @@ PRESET_USER_PASSWORD="[REDACTED]"
PRESET_USER_KEY=""
PRESET_DEFAULT_REALNAME="Armbian user"
PRESET_USER_SHELL="bash"
# ==========================================
# Set the Hostname
# ==========================================
NEW_HOSTNAME="opi1" # <-- Replace with your desired hostname
echo "Setting hostname to $NEW_HOSTNAME"
echo "$NEW_HOSTNAME" > /etc/hostname
hostname -b "$NEW_HOSTNAME"
sed -i "s/127.0.1.1.*/127.0.1.1\t$NEW_HOSTNAME/g" /etc/hosts