fickit-deploy: Dynamically update config at start and set expected IP on interface
This commit is contained in:
parent
49aa1682d7
commit
41ff4b9f50
2 changed files with 19 additions and 0 deletions
17
configs/deploy-initial-config.sh
Executable file
17
configs/deploy-initial-config.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Perform initial config..."
|
||||
|
||||
[ -z "${PXE_IFACE}" ] && PXE_IFACE=$(ip r | grep default | head -1 | cut -d " " -f 5)
|
||||
[ -z "${DEPLOY_NETWORK}" ] && DEPLOY_NETWORK=192.168.255
|
||||
|
||||
sed -i "s/eth0/${PXE_IFACE}/;s/192.168.255/${DEPLOY_NETWORK}/" /etc/udhcpd.conf
|
||||
|
||||
ip a show dev "${PXE_IFACE}" | grep "inet " | grep "${DEPLOY_NETWORK}" ||
|
||||
ip a add "${DEPLOY_NETWORK}.2/24" dev "${PXE_IFACE}"
|
||||
|
||||
echo "Initial config done."
|
||||
|
||||
exec $@
|
||||
Reference in a new issue