diff --git a/cyberpanel.sh b/cyberpanel.sh index be7af7c01..da9a9462a 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -628,7 +628,11 @@ install_cyberpanel_direct() { return 1 fi - chmod +x cyberpanel_installer.sh + # Make script executable and verify + chmod 755 cyberpanel_installer.sh 2>/dev/null || true + if [ ! -x "cyberpanel_installer.sh" ]; then + print_status "WARNING: Could not make cyberpanel_installer.sh executable, will use bash to execute" + fi # Download the install directory echo "Downloading installation files..." @@ -696,10 +700,25 @@ install_cyberpanel_direct() { echo "" # Run installer and show live output, capturing the password - if [ "$DEBUG_MODE" = true ]; then - ./cyberpanel_installer.sh --debug 2>&1 | tee /var/log/CyberPanel/install_output.log + # Use bash to execute to avoid permission issues + local installer_script="cyberpanel_installer.sh" + if [ ! -f "$installer_script" ]; then + print_status "ERROR: cyberpanel_installer.sh not found in current directory: $(pwd)" + return 1 + fi + + # Get absolute path to installer script + local installer_path + if [[ "$installer_script" = /* ]]; then + installer_path="$installer_script" else - ./cyberpanel_installer.sh 2>&1 | tee /var/log/CyberPanel/install_output.log + installer_path="$(pwd)/$installer_script" + fi + + if [ "$DEBUG_MODE" = true ]; then + bash "$installer_path" --debug 2>&1 | tee /var/log/CyberPanel/install_output.log + else + bash "$installer_path" 2>&1 | tee /var/log/CyberPanel/install_output.log fi local install_exit_code=${PIPESTATUS[0]}