summaryrefslogtreecommitdiffstats
path: root/core/modules/slx-network-configs-targets/data/opt/openslx/scripts/systemd-wait_primary_dhcp
blob: 3e452549875d68d06442f9d5fe844db1ee10b87e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/ash

flag="/run/network/primary-dhcp.flag"
readonly flag
w=0

# Wait a maximum of 10 seconds for the flag file
while ! [ -e "$flag" ] && [ "$w" -lt 10 ]; do
	let w++
	sleep 1
done

# Then touch it anyways, this will prevent the DHCP
# trigger script from changing the hostname later on
mkdir -p /run/network
touch "$flag"

exit 0