Skip to content

Commit

Permalink
board/common: override /etc/init.d/S40network
Browse files Browse the repository at this point in the history
Check if interfaces file exists, this makes it possible for
system containers to optionally create/mount one such file
to perform local network setup, e.g., run a dhcp client.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Sep 12, 2024
1 parent eb119e3 commit cf6a3d8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions board/common/rootfs/etc/init.d/S40network
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
#
# Start the network if enabled.
#

# Debian ifupdown needs the /run/network lock directory
mkdir -p /run/network

[ -f /etc/network/interfaces ] || exit 0

case "$1" in
start)
printf "Starting network: "
/sbin/ifup -a
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
printf "Stopping network: "
/sbin/ifdown -a
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)
"$0" stop
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?

0 comments on commit cf6a3d8

Please sign in to comment.