sudo bash -c 'cat > /var/www/html/index.html' << 'EOF'
Global Services Exchange | gServex.com
EOF
# Inject hreflang tags dynamically
for langfile in /var/www/html/index-*.html; do
code=$(basename "$langfile" | cut -d'-' -f2 | cut -d'.' -f1)
hreflang=$code
[[ "$code" == "zt" ]] && hreflang="zh-Hant"
echo " " | sudo tee -a /var/www/html/index.html >/dev/null
done
echo ' ' | sudo tee -a /var/www/html/index.html >/dev/null
# Finish page
sudo tee -a /var/www/html/index.html >/dev/null << 'EOF'
Redirecting you to your preferred language version...
If not redirected, click here.
EOF