Skip to content
Snippets Groups Projects
Commit 94bc1ab3 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

NET dhcpcd rozdělení enter-hook

parent 6012db7e
No related branches found
No related tags found
No related merge requests found
if [ "$ifssid" == MS-KAM-GUESTS ]
then
conntrack_hack
route6 default via 2001:718:1e03:81a::1 dev w metric 3004
fi
if [ "$ifssid" == blatto-jk-5g ] || [ "$ifssid" == blatto-jk-2g ]
then
conntrack_hack
route6 default via 2a01:510:d504:751a::1 dev w metric 3004
fi
if [ "$ifssid" == samet-5G ]
then
conntrack_hack
fi
if [ "$ifssid" == CDWiFi ]
then
mtu 1340
if [ "$reason" == BOUND ]
then
CDWIFI_IFACE=$interface cdwifi-autologin
fi
fi
if [ "$ifssid" == Onboard-WiFi ]
then
mtu 1340
fi
if [ "$ifssid" == OEBB ]
then
mtu 1340
fi
msg_prefix="$interface: dhcpd.enter-hook:"
echo $msg_prefix $reason $interface $if_up $ifssid
mtu_wg_blatto(){
ip link set wg-blatto mtu $1
}
mtu_limit(){
if [ "$reason" == CARRIER ]
then
if [[ $3 -le $2 ]]
then
$1 $3
else
$1 $2
fi
fi
if [ "$reason" == NOCARRIER ]
then
$1 $2
fi
}
mtu(){
mtu_limit mtu_wg_blatto 1432 $(( $1 - 60 ))
}
conntrack_hack(){
if [ "$reason" == CARRIER ]
then
echo $msg_prefix conntrack_hack
(echo R | socat unix:/run/conntrack_hack - ) &
fi
}
route6(){
if [ "$reason" == STATIC6 ]
then
echo $msg_prefix add ip route: $@
ip -6 route add $@
fi
if [ "$reason" == NOCARRIER ]
then
echo $msg_prefix del ip route: $@
ip -6 route del $@
fi
}
route(){
if [ "$reason" == STATIC ]
then
echo $msg_prefix add ip route: $@
ip -4 route add $@
fi
if [ "$reason" == NOCARRIER ]
then
echo $msg_prefix del ip route: $@
ip -4 route del $@
fi
}
#!/bin/sh
msg_prefix="$interface: dhcpd.enter-hook:"
echo $msg_prefix $reason $interface $if_up $ifssid
mtu_wg_blatto(){
ip link set wg-blatto mtu $1
}
mtu_limit(){
if [ "$reason" == CARRIER ]
then
if [[ $3 -le $2 ]]
then
$1 $3
else
$1 $2
fi
fi
if [ "$reason" == NOCARRIER ]
then
$1 $2
fi
}
mtu(){
mtu_limit mtu_wg_blatto 1432 $(( $1 - 60 ))
}
conntrack_hack(){
if [ "$reason" == CARRIER ]
then
echo $msg_prefix conntrack_hack
(echo R | socat unix:/run/conntrack_hack - ) &
fi
}
route6(){
if [ "$reason" == STATIC6 ]
then
echo $msg_prefix add ip route: $@
ip -6 route add $@
fi
if [ "$reason" == NOCARRIER ]
then
echo $msg_prefix del ip route: $@
ip -6 route del $@
fi
}
route(){
if [ "$reason" == STATIC ]
then
echo $msg_prefix add ip route: $@
ip -4 route add $@
fi
if [ "$reason" == NOCARRIER ]
then
echo $msg_prefix del ip route: $@
ip -4 route del $@
fi
}
. /etc/dhcpcd.enter-hook-defs
if [[ "$interface" == w ]]
then
if [ "$ifssid" == MS-KAM-GUESTS ]
then
conntrack_hack
route6 default via 2001:718:1e03:81a::1 dev w metric 3004
fi
if [ "$ifssid" == blatto-jk-5g ] || [ "$ifssid" == blatto-jk-2g ]
then
conntrack_hack
route6 default via 2a01:510:d504:751a::1 dev w metric 3004
fi
if [ "$ifssid" == samet-5G ]
then
conntrack_hack
fi
if [ "$ifssid" == CDWiFi ]
then
mtu 1340
if [ "$reason" == BOUND ]
then
CDWIFI_IFACE=$interface cdwifi-autologin
fi
fi
if [ "$ifssid" == Onboard-WiFi ]
then
mtu 1340
fi
. /etc/dhcpcd.enter-hook-defaults
if [ "$reason" == CARRIER ]
then
......
#!/bin/bash
cd "$(dirname "$0")"
. ../userconfig-lib.sh
version 8
version 9
need_root
install_begin
......@@ -24,7 +24,12 @@ do
done
[ -f $h/dhcpcd.conf ] && confln $h/dhcpcd.conf /etc/ cr
[ -f $h/dhcpcd.enter-hook ] && confln $h/dhcpcd.enter-hook /etc/ cr
if [ -f $h/dhcpcd.enter-hook ]
then
confln dhcpcd.enter-hook-defaults /etc/ cr
confln dhcpcd.enter-hook-defs /etc/ cr
confln $h/dhcpcd.enter-hook /etc/ cr
fi
r udevadm control --reload-rules
r udevadm trigger
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment