| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | sudo ln -sf "/usr/share/zoneinfo/$CAGE_TZ" /etc/localtime |
| 4 | printf '%s\n' "$CAGE_TZ" | sudo tee /etc/timezone >/dev/null |
| 5 | if ! locale -a | tr '[:upper:]' '[:lower:]' | grep -qx "${CAGE_LOCALE,,}" && ! locale -a | grep -q "${CAGE_LOCALE%%.*}.utf8"; then |
| 6 | printf '%s UTF-8\n' "$CAGE_LOCALE" | sudo tee -a /etc/locale.gen >/dev/null |
| 7 | sudo locale-gen >/dev/null |
| 8 | fi |
| 9 | printf 'TZ=%s\nLANG=%s\nLC_ALL=%s\nCAGE_LANGUAGE=%s\nBROWSER=/usr/local/bin/cage-open\nPULSE_SERVER=unix:/run/cage-audio/native\n' "$CAGE_TZ" "$CAGE_LOCALE" "$CAGE_LOCALE" "$CAGE_LANGUAGE" | sudo tee /etc/claude-cage/environment >/dev/null |
| 10 | sudo update-locale "LANG=$CAGE_LOCALE" "LC_ALL=$CAGE_LOCALE" |
| 11 | set -a |
| 12 | . /etc/claude-cage/environment |
| 13 | set +a |
| 14 | unset HTTP_PROXY HTTPS_PROXY ALL_PROXY FTP_PROXY NO_PROXY http_proxy https_proxy all_proxy ftp_proxy no_proxy |
| 15 | |
| 16 | |
| 17 | if [ -n "${CAGE_INSTALL_PROXY:-}" ]; then |
| 18 | export http_proxy="$CAGE_INSTALL_PROXY" https_proxy="$CAGE_INSTALL_PROXY" HTTP_PROXY="$CAGE_INSTALL_PROXY" HTTPS_PROXY="$CAGE_INSTALL_PROXY" |
| 19 | fi |