mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 06:37:26 +08:00
16 lines
509 B
Bash
Executable File
16 lines
509 B
Bash
Executable File
#!/bin/bash
|
|
# Detect if user is in China region based on timezone
|
|
# Returns: "china" or "international"
|
|
|
|
TIMEZONE=$(cat /etc/timezone 2>/dev/null || timedatectl show --property=Timezone --value 2>/dev/null || echo "Unknown")
|
|
|
|
# Check if timezone indicates China region (including Hong Kong)
|
|
if [[ "$TIMEZONE" == "Asia/Shanghai" ]] || \
|
|
[[ "$TIMEZONE" == "Asia/Hong_Kong" ]] || \
|
|
[[ "$TIMEZONE" == *"China"* ]] || \
|
|
[[ "$TIMEZONE" == *"Beijing"* ]]; then
|
|
echo "china"
|
|
else
|
|
echo "international"
|
|
fi
|