Limit VPN interface names to 15 chars

This commit is contained in:
Alexandre
2026-02-08 11:15:35 +01:00
parent 4fbdb04282
commit ed97320d8d
2 changed files with 8 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ elif [[ ${interface_name} = "tun" ]]; then
elif [[ ${interface_name} = "tap" ]]; then
interface_name='tap0'
fi
if [[ ${#interface_name} -gt 15 ]]; then
bashio::log.warning "OpenVPN interface name '${interface_name}' exceeds 15 characters; truncating to '${interface_name:0:15}'."
interface_name="${interface_name:0:15}"
fi
openvpn_runtime_config="${OPENVPN_STATE_DIR}/${interface_name}.conf"

View File

@@ -61,6 +61,10 @@ interface_name="$(basename "${wireguard_config}" .conf)"
if [[ -z "${interface_name}" ]]; then
interface_name='wg0'
fi
if [[ ${#interface_name} -gt 15 ]]; then
bashio::log.warning "WireGuard interface name '${interface_name}' exceeds 15 characters; truncating to '${interface_name:0:15}'."
interface_name="${interface_name:0:15}"
fi
wireguard_runtime_config="${WIREGUARD_STATE_DIR}/${interface_name}.conf"