diff --git a/scripts/import-disk-image.sh b/scripts/import-disk-image.sh index 30b07a4..ad2a95c 100644 --- a/scripts/import-disk-image.sh +++ b/scripts/import-disk-image.sh @@ -11,20 +11,18 @@ # ========================================================== -# Configuration -UTILS_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main/scripts/utils.sh" +# Configuration ============================================ +REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main" BASE_DIR="/usr/local/share/proxmenux" -CACHE_FILE="$BASE_DIR/cache.json" -VENV_PATH="/opt/googletrans-env" -LANGUAGE=$(jq -r '.language // "en"' "$BASE_DIR/config.json" 2>/dev/null) +UTILS_FILE="$BASE_DIR/utils.sh" +VENV_PATH="/opt/googletrans-env" - - -# Try to load utils.sh from GitHub -if ! source <(curl -sSf "$UTILS_URL"); then - echo "$(translate 'Error: Could not load utils.sh from') $UTILS_URL" - exit 1 +if [[ -f "$UTILS_FILE" ]]; then + source "$UTILS_FILE" fi +load_language +initialize_cache +# ========================================================== # Path where disk images are stored IMAGES_DIR="/var/lib/vz/template/images/"