hostname automation
This commit is contained in:
7
aptprimary.sh
Executable file
7
aptprimary.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Need armbian-config?
|
||||
|
||||
apt install -y vim git
|
||||
|
||||
apt install -y docker.io docker-cli docker-compose
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user