mirror of
https://github.com/0x1d/terraform-docker-packer.git
synced 2025-12-16 06:34:33 +01:00
provision image through Terraform
This commit is contained in:
7
examples/raspios/rootfs/lib/firstboot.sh
Executable file
7
examples/raspios/rootfs/lib/firstboot.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Generate a unique hostname
|
||||
NEW_HOSTNAME="rpi-$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2 | tail -c 5)"
|
||||
echo "$NEW_HOSTNAME" > /etc/hostname
|
||||
sed -i "s/raspberrypi/$NEW_HOSTNAME/g" /etc/hosts
|
||||
hostname "$NEW_HOSTNAME"
|
||||
Reference in New Issue
Block a user