summaryrefslogtreecommitdiffstats
path: root/hosts/profitbricks-build12-i386
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-03-30 16:27:23 +0200
committerHolger Levsen <holger@layer-acht.org>2017-03-30 16:27:23 +0200
commitef3e622dc86cf8c23cb643a3c1850ca8edaec27a (patch)
treeb168f39bcdef68b4984dd3e76cd620b4d2c7b319 /hosts/profitbricks-build12-i386
parent34c1585c61d79ebe1a317c4222b8e5cb6fbf9b3c (diff)
downloadjenkins.debian.net-ef3e622dc86cf8c23cb643a3c1850ca8edaec27a.tar.xz
reproducible Debian: set eth's MTU to 1500 on boot, if it's not set to 1500
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'hosts/profitbricks-build12-i386')
-rwxr-xr-xhosts/profitbricks-build12-i386/etc/rc.local14
1 files changed, 14 insertions, 0 deletions
diff --git a/hosts/profitbricks-build12-i386/etc/rc.local b/hosts/profitbricks-build12-i386/etc/rc.local
index 7a3ac282..9248a7a7 100755
--- a/hosts/profitbricks-build12-i386/etc/rc.local
+++ b/hosts/profitbricks-build12-i386/etc/rc.local
@@ -42,6 +42,16 @@ fixup_shm() {
chmod 1777 /dev/shm
}
+fixup_mtu() {
+ # only act on systems which have eth0
+ if ip link show eth0 >/dev/null 2>&1 ; then
+ # if MTU != 1500 set it to 1500
+ if [ "$(ip link show eth0 | sed -n '/LOOPBACK\|NOARP/!s/.* mtu \([0-9]*\) .*/\1/p' )" != "1500" ] ; then
+ ip link set dev eth0 mtu 1500
+ fi
+ fi
+}
+
#
# init, notify about reboots
#
@@ -79,6 +89,10 @@ esac
fixup_shm
#
+# fixup eth0's MTU if needed
+fixup_mtu
+
+#
# put schroots on tmpfs for non debian hosts
#
case $(hostname) in