From 4f323d7a8de10fb9b81d2141f2936c3d9ee4d6ea Mon Sep 17 00:00:00 2001 From: master3395 Date: Mon, 26 Jan 2026 21:27:16 +0100 Subject: [PATCH] Fix cyberpanel_installer.sh execution permission issues - Use bash to execute cyberpanel_installer.sh instead of relying on execute bit - Verify file exists before execution - Use absolute path to ensure correct file location - Improve chmod error handling with verification - Fixes 'Permission denied' error when cyberpanel.sh tries to execute installer --- cyberpanel.sh | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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]}