New paste Repaste Download
ln -sv ../init.d/gen-ifconfig /etc/rc.d/rcS.d/S60gen-ifconfig
#!/bin/sh
### BEGIN INIT INFO
# Provides:          gen-ifconfig
# Required-Start:    
# Required-Stop:     
# Default-Start:     S
# Default-Stop:
# Short-Description: Generate dynamic ifconfig files for network
### END INIT INFO
CONFIG_DIR=/etc/sysconfig
mkdir -p "$CONFIG_DIR"
echo "Generating dynamic interface config..."
for iface in $(ls /sys/class/net); do
    [ "$iface" = "lo" ] && continue
    FILE="$CONFIG_DIR/ifconfig.$iface"
    if [ ! -f "$FILE" ]; then
        echo "Creating $FILE"
        cat > "$FILE" <<EOF
ONBOOT="yes"
IFACE="$iface"
SERVICE="dhcpcd"
DHCP_START="-b -q -h $HOSTNAME"
DHCP_STOP="-k"
EOF
    fi
done
exit 0
Filename: None. Size: 739b. View raw, , hex, or download this file.

This paste expires on 2025-06-16 23:40:51.431340. Pasted through web.