Initial commit
This commit is contained in:
22
network/if-up.d/000resolvconf
Executable file
22
network/if-up.d/000resolvconf
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# ifup hook script for resolvconf
|
||||
# Written by Roy Marples <roy@marples.name> under the BSD-2 license
|
||||
|
||||
[ -x /sbin/resolvconf ] || exit 0
|
||||
case "$ADDRFAM" in
|
||||
inet|inet6) : ;;
|
||||
*) exit 0;;
|
||||
esac
|
||||
|
||||
conf=
|
||||
[ -n "$IF_DNS_DOMAIN" ] && conf="${conf}domain $IF_DNS_DOMAIN\n"
|
||||
[ -n "$IF_DNS_SEARCH" ] && conf="${conf}search $IF_DNS_SEARCH\n"
|
||||
[ -n "$IF_DNS_SORTLIST" ] && conf="${conf}sortlist $IF_DNS_SORTLIST\n"
|
||||
[ -n "$IF_DNS_OPTIONS" ] && conf="${conf}options $IF_DNS_OPTIONS\n"
|
||||
for nameserver in $IF_DNS_NAMESERVERS; do
|
||||
conf="${conf}nameserver $nameserver\n"
|
||||
done
|
||||
if [ -n "$conf" ]; then
|
||||
conf="# Generated by ifup for $IFACE.$ADDRFAM\n$conf"
|
||||
printf "$conf" | /sbin/resolvconf -a "$IFACE.$ADDRFAM"
|
||||
fi
|
||||
16
network/if-up.d/avahi-daemon
Executable file
16
network/if-up.d/avahi-daemon
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Don't run the avahi-daemon unicast local check while bringing up
|
||||
# the loopback device; it's not necessary until we bring up a real network
|
||||
# device
|
||||
[ "$IFACE" != "lo" ] || exit 0
|
||||
case "$ADDRFAM" in
|
||||
inet|inet6) ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
|
||||
# If we have an unicast .local domain, we immediately disable avahi to avoid
|
||||
# conflicts with the multicast IP4LL .local domain
|
||||
if [ -x /usr/lib/avahi/avahi-daemon-check-dns.sh ] ; then
|
||||
exec /usr/lib/avahi/avahi-daemon-check-dns.sh
|
||||
fi
|
||||
55
network/if-up.d/ethtool
Executable file
55
network/if-up.d/ethtool
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
ETHTOOL=/sbin/ethtool
|
||||
|
||||
test -x $ETHTOOL || exit 0
|
||||
|
||||
[ "$IFACE" != "lo" ] || exit 0
|
||||
|
||||
# Find settings with a given prefix and print them as they appeared in
|
||||
# /etc/network/interfaces, only with the prefix removed.
|
||||
# This actually prints each name and value on a separate line, but that
|
||||
# doesn't matter to the shell.
|
||||
gather_settings () {
|
||||
set | sed -n "
|
||||
/^IF_$1[A-Za-z0-9_]*=/ {
|
||||
h; # hold line
|
||||
s/^IF_$1//; s/=.*//; s/_/-/g; # get name without prefix
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; # lower-case
|
||||
p;
|
||||
g; # restore line
|
||||
s/^[^=]*=//; s/^'\(.*\)'/\1/; # get value
|
||||
p;
|
||||
}"
|
||||
}
|
||||
|
||||
# Gather together the mixed bag of settings applied with -s/--change
|
||||
SETTINGS="\
|
||||
${IF_LINK_SPEED:+ speed $IF_LINK_SPEED}\
|
||||
${IF_LINK_DUPLEX:+ duplex $IF_LINK_DUPLEX}\
|
||||
"
|
||||
|
||||
# WOL has an optional pass-key
|
||||
set -- $IF_ETHERNET_WOL
|
||||
SETTINGS="$SETTINGS${1:+ wol $1}${2:+ sopass $2}"
|
||||
|
||||
# Autonegotiation can be on|off or an advertising mask
|
||||
case "$IF_ETHERNET_AUTONEG" in
|
||||
'') ;;
|
||||
on|off) SETTINGS="$SETTINGS autoneg $IF_ETHERNET_AUTONEG" ;;
|
||||
*) SETTINGS="$SETTINGS autoneg on advertise $IF_ETHERNET_AUTONEG" ;;
|
||||
esac
|
||||
|
||||
[ -z "$SETTINGS" ] || $ETHTOOL --change "$IFACE" $SETTINGS
|
||||
|
||||
SETTINGS="$(gather_settings ETHERNET_PAUSE_)"
|
||||
[ -z "$SETTINGS" ] || $ETHTOOL --pause "$IFACE" $SETTINGS
|
||||
|
||||
SETTINGS="$(gather_settings HARDWARE_IRQ_COALESCE_)"
|
||||
[ -z "$SETTINGS" ] || $ETHTOOL --coalesce "$IFACE" $SETTINGS
|
||||
|
||||
SETTINGS="$(gather_settings HARDWARE_DMA_RING_)"
|
||||
[ -z "$SETTINGS" ] || $ETHTOOL --set-ring "$IFACE" $SETTINGS
|
||||
|
||||
SETTINGS="$(gather_settings OFFLOAD_)"
|
||||
[ -z "$SETTINGS" ] || $ETHTOOL --offload "$IFACE" $SETTINGS
|
||||
1
network/if-up.d/wpasupplicant
Symbolic link
1
network/if-up.d/wpasupplicant
Symbolic link
@@ -0,0 +1 @@
|
||||
../../wpa_supplicant/ifupdown.sh
|
||||
Reference in New Issue
Block a user