summaryrefslogtreecommitdiff
path: root/package/initramfs/root/etc/rcS.d/10network
blob: a496a65e4cfcae4ec546f9d0c2b60b23b3881cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/sh

# /etc/rcS.d/10network
#
# Bring up the network and interfaces.

[ -f /etc/config/network ] && . /etc/config/network

# Setting the hostname
if [ -n "$HOSTNAME" ]; then
    echo "Setting hostname...."
    hostname $HOSTNAME
    export HOSTNAME
fi

# Setting forwarding and defrag
if [ -f /proc/sys/net/ipv4/ip_forward ]; then
    if [ "$FORWARD_IPV4" = "no" ]; then
        value=0
        message="disabled"
    else
        value=1
        message="enabled"
    fi
    echo "$value" > /proc/sys/net/ipv4/ip_forward
    echo "IPv4 packet forwarding is ${message}...."
fi

if [ -f /proc/sys/net/ipv4/ip_always_defrag ]; then
    if [ "$DEFRAG_IPV4" = "yes" ]; then
        value=1
        message="enabled"
    else
        value=0
        message="disabled"
    fi
    echo "$value" > /proc/sys/net/ipv4/ip_always_defrag
    echo "IPv4 automatic defragmentation is ${message}...."
fi

ifup eth0
ifup plc0

touch /var/lock/subsys/network

exit 0