Update MTU function

This commit is contained in:
Cameron Thompson
2024-12-07 01:44:54 -05:00
parent 075046300b
commit a6a293116e

View File

@@ -226,12 +226,11 @@ mtu_setup() {
> "$mtu_file"
elif [[ "$response" =~ ^[0-9]+$ ]]; then
echo "Setting MTU override to $response..."
# Write the dynamic MTU script to the configuration file
{
echo "for iface in \$(ls /sys/class/net | grep '^rmnet_data'); do"
echo " ip link set \$iface mtu $response"
echo "done"
} > "$mtu_file"
# Write single commands for each interface to the configuration file
> "$mtu_file" # Clear the file
for iface in $(ls /sys/class/net | grep '^rmnet_data'); do
echo "ip link set $iface mtu $response" >> "$mtu_file"
done
else
echo "Invalid input. Please enter a number, 'exit', or '0'."
fi
@@ -240,6 +239,7 @@ mtu_setup() {
set_root_passwd() {
passwd
}