udhcpc service

This commit is contained in:
aliriza committed 2023-01-16 14:20:46 +00:00
1 parent 094e9fb2c2
commit aaeb35ffad
3 files changed
+45

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
NAME="udhcpc"
depend()
{
need localmount
keyword -vserver -lxc
}
start()
{
ebegin "Starting busybox networking"
for DEVICE in /sys/class/net/* ; do
ip link set ${DEVICE##*/} up
[ ${DEVICE##*/} != lo ] && udhcpc -b -i ${DEVICE##*/}
done
}
stop()
{
return 0
}
# vim:ts=4
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# This script gets called by udhcpc to setup the network interfaces
ip addr add $ip/$mask dev $interface
if [ "$router" ]; then
ip route add default via $router dev $interface
fi