mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update main_menu.sh
This commit is contained in:
parent
650aa43d8d
commit
42931b912c
@ -13,30 +13,17 @@
|
|||||||
|
|
||||||
# Configuration ============================================
|
# Configuration ============================================
|
||||||
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
|
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
|
||||||
UTILS_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main/scripts/utils.sh"
|
|
||||||
BASE_DIR="/usr/local/share/proxmenux"
|
BASE_DIR="/usr/local/share/proxmenux"
|
||||||
CACHE_FILE="$BASE_DIR/cache.json"
|
UTILS_FILE="$BASE_DIR/utils.sh"
|
||||||
VENV_PATH="/opt/googletrans-env"
|
VENV_PATH="/opt/googletrans-env"
|
||||||
# LANGUAGE=$(jq -r '.language // "en"' "$BASE_DIR/config.json" 2>/dev/null)
|
|
||||||
|
|
||||||
|
if [[ -f "$UTILS_FILE" ]]; then
|
||||||
|
source "$UTILS_FILE"
|
||||||
|
|
||||||
if ! source <(curl -sSf "$UTILS_URL"); then
|
|
||||||
echo "$(translate 'Error: Could not load utils.sh from') $UTILS_URL"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
initialize_cache() {
|
load_language
|
||||||
if [ ! -f "$CACHE_FILE" ]; then
|
initialize_cache
|
||||||
echo "{}" > "$CACHE_FILE"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
load_language() {
|
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
|
||||||
LANGUAGE=$(jq -r '.language' "$CONFIG_FILE")
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user