Use sh to execute cyberpanel.sh to avoid permission issues

- Execute with 'sh' instead of relying on exec permissions
- More reliable in process substitution context
- Handles cases where chmod might not work properly
This commit is contained in:
master3395
2026-01-26 21:16:01 +01:00
parent 6161081b98
commit 4b99e46bfd

View File

@@ -111,9 +111,10 @@ if [ "$BRANCH_NAME" = "v2.5.5-dev" ] || [ "$BRANCH_NAME" = "stable" ]; then
# Try to download from the branch-specific URL
if curl --silent -o "$SCRIPT_PATH" "https://raw.githubusercontent.com/master3395/cyberpanel/$BRANCH_NAME/cyberpanel.sh" 2>/dev/null; then
if [ -f "$SCRIPT_PATH" ] && [ -s "$SCRIPT_PATH" ]; then
chmod +x "$SCRIPT_PATH"
chmod +x "$SCRIPT_PATH" 2>/dev/null || true
echo "✅ Downloaded cyberpanel.sh from branch $BRANCH_NAME"
exec "$SCRIPT_PATH" "$@"
# Use sh to execute to avoid permission issues
exec sh "$SCRIPT_PATH" "$@"
fi
fi
fi
@@ -122,9 +123,10 @@ fi
if curl --silent -o "$SCRIPT_PATH" "https://cyberpanel.sh/?dl&$SERVER_OS" 2>/dev/null || \
wget -q -O "$SCRIPT_PATH" "https://cyberpanel.sh/?dl&$SERVER_OS" 2>/dev/null; then
if [ -f "$SCRIPT_PATH" ] && [ -s "$SCRIPT_PATH" ]; then
chmod +x "$SCRIPT_PATH"
chmod +x "$SCRIPT_PATH" 2>/dev/null || true
echo "✅ Downloaded cyberpanel.sh from standard source"
exec "$SCRIPT_PATH" "$@"
# Use sh to execute to avoid permission issues
exec sh "$SCRIPT_PATH" "$@"
fi
fi