Wip
This commit is contained in:
@@ -17,9 +17,9 @@ TIMEZONE="America/New_York"
|
||||
# These are set during installation and can be changed here post-install.
|
||||
|
||||
# --- Console font -----------------------------------------------------------
|
||||
FONT="ter-v18n"
|
||||
# Terminus font at 18px — crisp on high-DPI displays. Requires kbd package.
|
||||
# Set to "" to use the kernel default.
|
||||
FONT=""
|
||||
# Set to "" for kernel default. Can use "ter-v18n" (Terminus 18px) if
|
||||
# terminus-font package is installed. Requires kbd package for setfont.
|
||||
|
||||
# --- Daemons to start at boot ----------------------------------------------
|
||||
# Order matters. Each name corresponds to a script in /etc/rc.d/
|
||||
|
||||
@@ -8,17 +8,33 @@
|
||||
. /etc/rc.conf
|
||||
|
||||
DAEMON="/usr/sbin/dhcpcd"
|
||||
PIDFILE="/run/dhcpcd-${NETWORK_INTERFACE}.pid"
|
||||
|
||||
# Auto-detect network interface if configured one doesn't exist
|
||||
IFACE="${NETWORK_INTERFACE}"
|
||||
if [ ! -d "/sys/class/net/${IFACE}" ] || [ "${IFACE}" = "lo" ]; then
|
||||
# Find first non-loopback ethernet interface
|
||||
for d in /sys/class/net/*; do
|
||||
name=$(basename "$d")
|
||||
[ "$name" = "lo" ] && continue
|
||||
# Skip wireless (has wireless/ subdir)
|
||||
[ -d "$d/wireless" ] && continue
|
||||
IFACE="$name"
|
||||
echo " NOTE: ${NETWORK_INTERFACE} not found, using ${IFACE}"
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
||||
PIDFILE="/run/dhcpcd-${IFACE}.pid"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo " Starting dhcpcd on ${NETWORK_INTERFACE}..."
|
||||
echo " Starting dhcpcd on ${IFACE}..."
|
||||
if [ "${NETWORK_DHCP}" = "yes" ]; then
|
||||
${DAEMON} -q "${NETWORK_INTERFACE}" && echo " dhcpcd started"
|
||||
${DAEMON} -q "${IFACE}" && echo " dhcpcd started"
|
||||
else
|
||||
# Static IP configuration
|
||||
ip addr add "${NETWORK_IP}/${NETWORK_MASK}" dev "${NETWORK_INTERFACE}"
|
||||
ip link set "${NETWORK_INTERFACE}" up
|
||||
ip addr add "${NETWORK_IP}/${NETWORK_MASK}" dev "${IFACE}"
|
||||
ip link set "${IFACE}" up
|
||||
ip route add default via "${NETWORK_GATEWAY}"
|
||||
if [ -n "${NETWORK_DNS}" ]; then
|
||||
echo "# Generated by rc.d/dhcpcd" > /etc/resolv.conf
|
||||
@@ -32,7 +48,7 @@ case "$1" in
|
||||
stop)
|
||||
echo " Stopping dhcpcd..."
|
||||
if [ -f "${PIDFILE}" ]; then
|
||||
${DAEMON} -x "${NETWORK_INTERFACE}" 2>/dev/null
|
||||
${DAEMON} -x "${IFACE}" 2>/dev/null
|
||||
fi
|
||||
echo " dhcpcd stopped"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user