summaryrefslogblamecommitdiffstats
path: root/builder/modules.d/slx-network/hooks/activate-bootif-dhcp.sh
blob: 179254d005b2ba66dd85d8c516e8861a48364892 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                       
                                                                                   

                                                                     
                                                  
 
#!/bin/bash

. /run/openslx/network.conf

for script in setup-bootif-network udhcpc-trigger; do
	if [ -e "${NEWROOT}/opt/openslx/scripts/${script}" ]; then
		mv "${NEWROOT}/opt/openslx/scripts/${script}"{,.stage4}
	fi
	cp -f "/opt/openslx/scripts/${script}.stage4" \
		"${NEWROOT}/opt/openslx/scripts/${script}"
done

# copy udhcpc@ systemd service, backup existing ones for debugging
mkdir -p "${NEWROOT}/etc/systemd/system"
cp -f "/opt/openslx/services/udhcpc-bootif.service" "${NEWROOT}/etc/systemd/system"

# activate it for the bridge or the physical interface if not bridged
systemctl --root "$NEWROOT" enable "udhcpc-bootif"