]> TLD Linux GIT Repositories - rc-scripts.git/blob - lib/ifup-post
- disable lock checks (happens on LUKS2 and fails during system boot)
[rc-scripts.git] / lib / ifup-post
1 #!/bin/sh
2 #
3 #
4
5 run_up() { :; }
6
7 . /etc/rc.d/init.d/functions
8 . /etc/sysconfig/network
9 . /lib/rc-scripts/functions.network
10
11 need_hostname
12 CONFIG=$1
13 source_config
14
15 # set all major variables
16 setup_ip_param
17
18 # set REALDEVICE
19 get_ppp_device_and_pid
20
21 # Simple QoS support (bandwidth limit)
22 if [ -n "${BANDWIDTH_OUT}" ]; then
23         if [ "${QDISC_CLASS}" = "htb" -o "${QDISC_CLASS}" = "cbq" ]; then
24                 case "${QDISC_CLASS}" in
25                   htb)
26                         tc qdisc add dev ${REALDEVICE} root handle 1: htb default 10
27                         tc class add dev ${REALDEVICE} parent 1: classid 1:10 htb rate ${BANDWIDTH_OUT}kbit ceil ${BANDWIDTH_OUT}kbit
28                         [ -n "${QDISC}" ] && tc qdisc add dev ${REALDEVICE} parent 1:10 ${QDISC}
29                         ;;
30                   cbq)
31                         # FIXME: hardcoded ethernet speed (bandwidth)
32                         tc qdisc add dev ${REALDEVICE} root handle 1: cbq bandwidth 100000kbit cell 8 avpkt 1000 mpu 64
33                         tc class add dev ${REALDEVICE} parent 1: classid 1:10 cbq bandwidth 100000kbit rate ${BANDWIDTH_OUT}kbit maxburst 5 avpkt 1000 allot 1514 bounded
34                         [ -n "${QDISC}" ] && tc qdisc add dev ${REALDEVICE} parent 1:10 ${QDISC}
35                         tc filter add dev ${REALDEVICE} protocol ip parent 1: u32 match ip src 0.0.0.0/0 flowid 1:10
36                         ;;
37                 esac
38         elif [ -z "${QDISC}" -o "${QDISC}" = "tbf" ]; then
39                 tc qdisc add dev ${REALDEVICE} root tbf rate ${BANDWIDTH_OUT}kbit latency 50ms burst 51200
40         elif [ -n "${QDISC}" ]; then
41                 tc qdisc add dev ${REALDEVICE} root ${QDISC}
42         fi
43 else
44         if [ -n "${QDISC}" ]; then
45                 tc qdisc add dev ${REALDEVICE} root ${QDISC}
46         fi
47 fi
48
49 if [ -n "${BANDWIDTH_IN}" ]; then
50         tc qdisc add dev ${REALDEVICE} handle ffff: ingress
51         tc filter add dev ${REALDEVICE} parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${BANDWIDTH_IN}kbit burst 10k drop flowid :3
52 fi
53
54 . /lib/rc-scripts/ifup-aliases
55 . /lib/rc-scripts/ifup-routes
56 . /lib/rc-scripts/ifup-neigh
57
58 # don't set hostname on ppp/slip connections
59 if [ -n "$NEEDHOSTNAME" -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then
60         IPADDR=$(ip -f inet addr show dev ${DEVICE} |
61                 awk '/inet/ { print $2 }' |awk -F"/" '{ print $1 }')
62         eval $(/bin/ipcalc --silent --hostname ${IPADDR}) && set_hostname $HOSTNAME
63 fi
64
65 # run tleds software
66 if [ "$TLEDS_DEV" = "$DEVICE" -a -x /usr/bin/tleds ]; then
67         /usr/bin/tleds -qc "$DEVICE"
68 fi
69
70 # execute run_up() function (if available in device configuration file)
71 run_up
72
73 # Notify programs that have requested notification
74 do_netreport
75
76 exit 0