Skip to content

Commit cf6a3d8

Browse files
committed
board/common: override /etc/init.d/S40network
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]>
1 parent eb119e3 commit cf6a3d8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# Start the network if enabled.
4+
#
5+
6+
# Debian ifupdown needs the /run/network lock directory
7+
mkdir -p /run/network
8+
9+
[ -f /etc/network/interfaces ] || exit 0
10+
11+
case "$1" in
12+
start)
13+
printf "Starting network: "
14+
/sbin/ifup -a
15+
[ $? = 0 ] && echo "OK" || echo "FAIL"
16+
;;
17+
stop)
18+
printf "Stopping network: "
19+
/sbin/ifdown -a
20+
[ $? = 0 ] && echo "OK" || echo "FAIL"
21+
;;
22+
restart|reload)
23+
"$0" stop
24+
"$0" start
25+
;;
26+
*)
27+
echo "Usage: $0 {start|stop|restart}"
28+
exit 1
29+
esac
30+
31+
exit $?

0 commit comments

Comments
 (0)