2021-10-25 18:12:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
|
|
|
function clickhouse_local()
|
|
|
|
{
|
|
|
|
local opts=(
|
|
|
|
--config "$CURDIR/$(basename "${BASH_SOURCE[0]}" .sh).config.xml"
|
|
|
|
--top_level_domains_path "$CURDIR"
|
|
|
|
)
|
|
|
|
$CLICKHOUSE_LOCAL "${opts[@]}" "$@"
|
|
|
|
}
|
|
|
|
|
2023-09-04 20:38:37 +00:00
|
|
|
# -- dev.ss is not in the default TLD list, hence:
|
2021-10-25 18:12:45 +00:00
|
|
|
clickhouse_local -q "
|
|
|
|
select
|
2023-09-04 20:38:37 +00:00
|
|
|
cutToFirstSignificantSubdomain('foo.kernel.dev.ss'),
|
|
|
|
cutToFirstSignificantSubdomainCustom('foo.kernel.dev.ss', 'public_suffix_list')
|
2021-10-25 18:12:45 +00:00
|
|
|
" |& grep -v -e 'Processing configuration file'
|