feat: provision ip-address
This commit is contained in:
parent
d289f49cfb
commit
8f150a20ef
1 changed files with 15 additions and 0 deletions
|
|
@ -33,12 +33,27 @@ unmount_temporary () {
|
||||||
rmdir $1
|
rmdir $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provision_network () {
|
||||||
|
mnt_point=$1
|
||||||
|
|
||||||
|
echo "Provision network"
|
||||||
|
cat > $mnt_handle/network-config <<EOF
|
||||||
|
network:
|
||||||
|
version: 2
|
||||||
|
ethernets:
|
||||||
|
eth0:
|
||||||
|
addresses: [$NET_ADDR]
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
read -e -p "Compressed Image file: " IMG_FILE
|
read -e -p "Compressed Image file: " IMG_FILE
|
||||||
read -e -p "SD Card: " SD_CARD
|
read -e -p "SD Card: " SD_CARD
|
||||||
|
read -e -p "IP-Address with prefix (comma separated): " NET_ADDR
|
||||||
|
|
||||||
flash_sd "$IMG_FILE" "$SD_CARD"
|
flash_sd "$IMG_FILE" "$SD_CARD"
|
||||||
enlarge_partition "$SD_CARD"
|
enlarge_partition "$SD_CARD"
|
||||||
mnt_handle=$(mount_temporary "1")
|
mnt_handle=$(mount_temporary "1")
|
||||||
|
|
||||||
|
provision_network $mnt_handle
|
||||||
|
|
||||||
unmount_temporary $mnt_handle
|
unmount_temporary $mnt_handle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue